From 6b3b564f62aca0d3184e3c90be767bba10d0faaa Mon Sep 17 00:00:00 2001 From: jake Date: Mon, 10 Feb 2025 14:38:14 -0800 Subject: [PATCH] changed BP to SS for switch state. --- inc/main.h | 6 +++--- src/main.c | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/inc/main.h b/inc/main.h index 6f6ffa2..b3d99d7 100644 --- a/inc/main.h +++ b/inc/main.h @@ -26,10 +26,10 @@ #define START_PATTERN 0xAA #define END_PATTERN 0x55 -//Addresses in the eeprom for the two bypasses +//Addresses in the eeprom for the two switch states #define ROM_SP_ADR 0x0 -#define ROM_BP1_ADR 0x1 -#define ROM_BP2_ADR 0x2 +#define ROM_SS1_ADR 0x1 +#define ROM_SS2_ADR 0x2 #define ROM_EP_ADR 0x3 //Debounce check number. diff --git a/src/main.c b/src/main.c index 70b917e..426a377 100644 --- a/src/main.c +++ b/src/main.c @@ -95,12 +95,12 @@ void init_prog(void) //Checks against a bit pattern we defined to represent the start of data. if(eeprom_read_byte((uint8_t *)ROM_SP_ADR) == START_PATTERN) { //Reads the two bytes representing the two states. - btn1.is_active = eeprom_read_byte((uint8_t *)ROM_BP1_ADR); + btn1.is_active = eeprom_read_byte((uint8_t *)ROM_SS1_ADR); } else { //otherwise we write the init values for the start pattern and states. eeprom_write_byte((uint8_t *)ROM_SP_ADR, START_PATTERN); - eeprom_write_byte((uint8_t *)ROM_BP1_ADR, 0x0); + eeprom_write_byte((uint8_t *)ROM_SS1_ADR, 0x0); } btn1.is_pressed = ((PINB & (1<