set the blink delay too 20 instead of 200

This commit is contained in:
jakeg00dwin 2024-05-22 19:34:50 -07:00
parent 5da6bd3219
commit 34778b7e04
1 changed files with 6 additions and 9 deletions

15
main.c
View File

@ -5,6 +5,8 @@
* has options to save settings in EEPROM. * has options to save settings in EEPROM.
*/ */
//#define __AVR_ATtiny13A__
#ifndef MCU #ifndef MCU
#define MCU atiny13a #define MCU atiny13a
#endif #endif
@ -45,10 +47,6 @@
//Debounce check number. //Debounce check number.
#define MAX_CHECKS 5 #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_SW2 PINB3
#define PIN_BYPASS2 PB4 #define PIN_BYPASS2 PB4
#define PIN_SW1 PINB2 #define PIN_SW1 PINB2
@ -58,7 +56,7 @@
//The BLINK_QTY can be edited from 0-255 blinks //The BLINK_QTY can be edited from 0-255 blinks
#define BLINK_QTY 2 #define BLINK_QTY 2
#define BLINK_CNT 2 * BLINK_QTY #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); init_btn(&btn2, PIN_SW2, PIN_BYPASS2);
/*Wait 5ms for pull-up resistors voltage to become stable.*/ /*Wait 5ms for pull-up resistors voltage to become stable.*/
//_delay_ms(5); _delay_ms(5);
/*check if the eeprom has info. */ /*check if the eeprom has info. */
while(! eeprom_is_ready()) {} //Blocks until eeprom is ready. 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*/ /*The interrupt service routine for the timer0*/
ISR(TIM0_OVF_vect, ISR_BLOCK) ISR(TIM0_OVF_vect, ISR_BLOCK)
{ {
cli();
/*Check the state of the switches*/ /*Check the state of the switches*/
debounce_switch(); debounce_switch();
@ -391,7 +389,6 @@ ISR(TIM0_OVF_vect, ISR_BLOCK)
btn2.pressed_ticks += 1; btn2.pressed_ticks += 1;
} }
/*Re-Enable global interrupts*/ /*Re-Enable global interrupts*/
sei(); sei();
} }