From 34778b7e04cb321cad26271c191afe72ff2d7a31 Mon Sep 17 00:00:00 2001 From: jakeg00dwin Date: Wed, 22 May 2024 19:34:50 -0700 Subject: [PATCH] set the blink delay too 20 instead of 200 --- main.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/main.c b/main.c index d2b7b80..9a15a22 100644 --- a/main.c +++ b/main.c @@ -5,6 +5,8 @@ * has options to save settings in EEPROM. */ +//#define __AVR_ATtiny13A__ + #ifndef MCU #define MCU atiny13a #endif @@ -45,10 +47,6 @@ //Debounce check number. #define MAX_CHECKS 5 -// Define DISABLE_TEMPORARY_SWITCH to turn off the ability to hold -// the switch to temporarily engage/bypass. -//#define DISABLE_TEMPORARY_SWITCH - #define PIN_SW2 PINB3 #define PIN_BYPASS2 PB4 #define PIN_SW1 PINB2 @@ -58,7 +56,7 @@ //The BLINK_QTY can be edited from 0-255 blinks #define BLINK_QTY 2 #define BLINK_CNT 2 * BLINK_QTY -#define BLINK_DELAY 200 +#define BLINK_DELAY 20 @@ -134,7 +132,7 @@ void init_prog() init_btn(&btn2, PIN_SW2, PIN_BYPASS2); /*Wait 5ms for pull-up resistors voltage to become stable.*/ - //_delay_ms(5); + _delay_ms(5); /*check if the eeprom has info. */ while(! eeprom_is_ready()) {} //Blocks until eeprom is ready. @@ -375,11 +373,11 @@ static inline void init_timer0() { } -//ISR(TIMER0_OVF_vect) - /*The interrupt service routine for the timer0*/ ISR(TIM0_OVF_vect, ISR_BLOCK) { + cli(); + /*Check the state of the switches*/ debounce_switch(); @@ -391,7 +389,6 @@ ISR(TIM0_OVF_vect, ISR_BLOCK) btn2.pressed_ticks += 1; } - /*Re-Enable global interrupts*/ sei(); }