1.1 --- a/pic32_c.h Thu Oct 18 21:05:18 2018 +0200
1.2 +++ b/pic32_c.h Thu Oct 18 22:45:55 2018 +0200
1.3 @@ -47,14 +47,19 @@
1.4 return DCHBASE + reg + (channel - DCHMIN) * DCHSTEP;
1.5 }
1.6
1.7 -static inline uint32_t TIMER_REG(int channel, uint32_t reg)
1.8 +static inline uint32_t OC_REG(int unit, uint32_t reg)
1.9 {
1.10 - return TIMERBASE + reg + (channel - TIMERMIN) * TIMERSTEP;
1.11 + return OCBASE + reg + (unit - OCMIN) * OCSTEP;
1.12 }
1.13
1.14 -static inline uint32_t UART_REG(int channel, uint32_t reg)
1.15 +static inline uint32_t TIMER_REG(int timer, uint32_t reg)
1.16 {
1.17 - return UARTBASE + reg + (channel - UARTMIN) * UARTSTEP;
1.18 + return TIMERBASE + reg + (timer - TIMERMIN) * TIMERSTEP;
1.19 +}
1.20 +
1.21 +static inline uint32_t UART_REG(int uart, uint32_t reg)
1.22 +{
1.23 + return UARTBASE + reg + (uart - UARTMIN) * UARTSTEP;
1.24 }
1.25
1.26 /* Convenience types. */