From 70c7c567a60a08eb18ffa252259dfd9fe40b7137 Mon Sep 17 00:00:00 2001 From: Christian Kroll Date: Sat, 17 Oct 2015 20:48:14 +0200 Subject: [PATCH] my personal ocd --- src/borg_hw/borg_hw_andreborg.c | 8 ++++---- src/borg_hw/borg_hw_borg16.c | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/borg_hw/borg_hw_andreborg.c b/src/borg_hw/borg_hw_andreborg.c index b32ee8f..da86ed5 100644 --- a/src/borg_hw/borg_hw_andreborg.c +++ b/src/borg_hw/borg_hw_andreborg.c @@ -19,18 +19,18 @@ defined(__AVR_ATmega644P__) || \ defined(__AVR_ATmega1284__) || \ defined(__AVR_ATmega1284P__) -# define TIMER0_OFF() TCCR0A = 0; TCCR0B = 0 +# define TIMER0_OFF() TIMSK0 &= ~(OCIE0A); TCCR0A = 0; TCCR0B = 0 # define TIMER0_CTC_CS256() TCCR0A = _BV(WGM01); TCCR0B = _BV(CS02) # define TIMER0_RESET() TCNT0 = 0 # define TIMER0_COMPARE(t) OCR0A = t -# define TIMER0_INT_ENABLE() TIMSK0 = _BV(OCIE0A) +# define TIMER0_INT_ENABLE() TIMSK0 |= _BV(OCIE0A) # define TIMER0_ISR TIMER0_COMPA_vect #else // ATmega16/32 -# define TIMER0_OFF() TCCR0 = 0 +# define TIMER0_OFF() TIMSK0 &= ~(OCIE0); TCCR0 = 0 # define TIMER0_CTC_CS256() TCCR0 = _BV(WGM01) | _BV(CS02) # define TIMER0_RESET() TCNT0 = 0 # define TIMER0_COMPARE(t) OCR0 = t -# define TIMER0_INT_ENABLE() TIMSK = _BV(OCIE0) +# define TIMER0_INT_ENABLE() TIMSK |= _BV(OCIE0) # define TIMER0_ISR TIMER0_COMP_vect #endif diff --git a/src/borg_hw/borg_hw_borg16.c b/src/borg_hw/borg_hw_borg16.c index 9a65830..2870c14 100644 --- a/src/borg_hw/borg_hw_borg16.c +++ b/src/borg_hw/borg_hw_borg16.c @@ -41,18 +41,18 @@ defined(__AVR_ATmega644P__) || \ defined(__AVR_ATmega1284__) || \ defined(__AVR_ATmega1284P__) -# define TIMER0_OFF() TCCR0A = 0; TCCR0B = 0 +# define TIMER0_OFF() TIMSK0 &= ~(OCIE0A); TCCR0A = 0; TCCR0B = 0 # define TIMER0_CTC_CS256() TCCR0A = _BV(WGM01); TCCR0B = _BV(CS02) # define TIMER0_RESET() TCNT0 = 0 # define TIMER0_COMPARE(t) OCR0A = t -# define TIMER0_INT_ENABLE() TIMSK0 = _BV(OCIE0A) +# define TIMER0_INT_ENABLE() TIMSK0 |= _BV(OCIE0A) # define TIMER0_ISR TIMER0_COMPA_vect #else // ATmega16/32 -# define TIMER0_OFF() TCCR0 = 0 +# define TIMER0_OFF() TIMSK0 &= ~(OCIE0); TCCR0 = 0 # define TIMER0_CTC_CS256() TCCR0 = _BV(WGM01) | _BV(CS02) # define TIMER0_RESET() TCNT0 = 0 # define TIMER0_COMPARE(t) OCR0 = t -# define TIMER0_INT_ENABLE() TIMSK = _BV(OCIE0) +# define TIMER0_INT_ENABLE() TIMSK |= _BV(OCIE0) # define TIMER0_ISR TIMER0_COMP_vect #endif