@@ -58,9 +58,9 @@ typedef uint16_t hal_timer_t;
5858#define DISABLE_STEPPER_DRIVER_INTERRUPT () CBI(TIMSK1, OCIE1A)
5959#define STEPPER_ISR_ENABLED () TEST(TIMSK1, OCIE1A)
6060
61- #define ENABLE_TEMPERATURE_INTERRUPT () SBI(TIMSK0, OCIE0B )
62- #define DISABLE_TEMPERATURE_INTERRUPT () CBI(TIMSK0, OCIE0B )
63- #define TEMPERATURE_ISR_ENABLED () TEST(TIMSK0, OCIE0B )
61+ #define ENABLE_TEMPERATURE_INTERRUPT () SBI(TIMSK0, OCIE0A )
62+ #define DISABLE_TEMPERATURE_INTERRUPT () CBI(TIMSK0, OCIE0A )
63+ #define TEMPERATURE_ISR_ENABLED () TEST(TIMSK0, OCIE0A )
6464
6565FORCE_INLINE void HAL_timer_start (const uint8_t timer_num , const uint32_t ) {
6666 switch (timer_num ) {
@@ -87,7 +87,7 @@ FORCE_INLINE void HAL_timer_start(const uint8_t timer_num, const uint32_t) {
8787 case MF_TIMER_TEMP :
8888 // Use timer0 for temperature measurement
8989 // Interleave temperature interrupt with millies interrupt
90- OCR0B = 128 ;
90+ OCR0A = 128 ;
9191 break ;
9292 }
9393}
@@ -180,7 +180,7 @@ void TIMER1_COMPA_vect() { \
180180 : \
181181 : [timsk0 ] "i" ((uint16_t )& TIMSK0 ), \
182182 [timsk1 ] "i " ((uint16_t)&TIMSK1), \
183- [msk0] " M " ((uint8_t)(1<<OCIE0B )),\
183+ [msk0] " M " ((uint8_t)(1<<OCIE0A )),\
184184 [msk1] " M " ((uint8_t)(1<<OCIE1A)) \
185185 : \
186186 ); \
@@ -193,9 +193,9 @@ void TIMER1_COMPA_vect_bottom()
193193
194194/* 14 cycles maximum latency */
195195#define HAL_TEMP_TIMER_ISR () \
196- extern "C" void TIMER0_COMPB_vect () __attribute__ ((signal, naked, used, externally_visible)); \
197- extern "C" void TIMER0_COMPB_vect_bottom () asm ("TIMER0_COMPB_vect_bottom ") __attribute__ ((used, externally_visible, noinline)); \
198- void TIMER0_COMPB_vect () { \
196+ extern "C" void TIMER0_COMPA_vect () __attribute__ ((signal, naked, used, externally_visible)); \
197+ extern "C" void TIMER0_COMPA_vect_bottom () asm ("TIMER0_COMPA_vect_bottom ") __attribute__ ((used, externally_visible, noinline)); \
198+ void TIMER0_COMPA_vect () { \
199199 __asm__ __volatile__ ( \
200200 A("push r16") /* 2 Save R16 */ \
201201 A ("in r16, __SREG__" ) /* 1 Get SREG */ \
@@ -223,7 +223,7 @@ void TIMER0_COMPB_vect() { \
223223 A ("push r30" ) \
224224 A ("push r31" ) \
225225 A ("clr r1" ) /* C runtime expects this register to be 0 */ \
226- A ("call TIMER0_COMPB_vect_bottom " ) /* Call the bottom handler - No inlining allowed, otherwise registers used are not saved */ \
226+ A ("call TIMER0_COMPA_vect_bottom " ) /* Call the bottom handler - No inlining allowed, otherwise registers used are not saved */ \
227227 A ("pop r31" ) \
228228 A ("pop r30" ) \
229229 A ("pop r27" ) \
@@ -251,10 +251,10 @@ void TIMER0_COMPB_vect() { \
251251 A ("reti" ) /* 4 Return from interrupt */ \
252252 : \
253253 : [timsk0 ] "i" ((uint16_t )& TIMSK0 ), \
254- [msk0 ] "M " ((uint8_t)(1<<OCIE0B )) \
254+ [msk0 ] "M " ((uint8_t)(1<<OCIE0A )) \
255255 : \
256256 ); \
257257} \
258- void TIMER0_COMPB_vect_bottom ()
258+ void TIMER0_COMPA_vect_bottom ()
259259
260260#endif // HAL_TEMP_TIMER_ISR
0 commit comments