From 3d0a13deade9ea5a59e1d4ea0f8b61144859ca3e Mon Sep 17 00:00:00 2001 From: true Date: Sat, 9 Nov 2024 21:22:38 -0800 Subject: [PATCH] minor comments updates --- nametag8_CH592/user/comm/soft_i2c_slave.c | 7 ++++--- nametag8_CH592/user/main.c | 6 ++++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/nametag8_CH592/user/comm/soft_i2c_slave.c b/nametag8_CH592/user/comm/soft_i2c_slave.c index d5e8eb7..153ed16 100644 --- a/nametag8_CH592/user/comm/soft_i2c_slave.c +++ b/nametag8_CH592/user/comm/soft_i2c_slave.c @@ -112,9 +112,10 @@ int8_t i2css_idle_init(struct I2CSoftSlave *slave) // set up a hardware timer to tick our idle timer // idle_timeout = slave->bit_time * I2CSS_IDLE_TIMEOUT; + return I2CSS_OK; } -// returns 0 if idle, or -1 if not idle. +// returns 0 if idle, or some other value if not idle. // if not idle, restarts the idle timer. __HIGH_CODE int8_t i2css_idle_check(struct I2CSoftSlave *slave) @@ -123,12 +124,12 @@ int8_t i2css_idle_check(struct I2CSoftSlave *slave) // if we're idle, then we're done if (!idle_timeout) { - return 0; + return I2CSS_OK; } // not idle. restart the idle timer. i2css_idle_init(slave); - return -1; + return I2CSS_IDLE_TIMEOUT; } __HIGH_CODE diff --git a/nametag8_CH592/user/main.c b/nametag8_CH592/user/main.c index acb3dc1..bdff234 100644 --- a/nametag8_CH592/user/main.c +++ b/nametag8_CH592/user/main.c @@ -21,6 +21,8 @@ * * todo: * - decouple oled render routine from interrupt off time. not an issue for now... + * - shrink main tick interrupt routine to incrementing a flag + * - implement better CPU usage statistics * */ @@ -58,7 +60,7 @@ #define PROG_TICK_RATE ((32768-8192-4096) / 256) // not sure why this value can't be 32768/256 // this was checked with a stopwatch and is close enough - // this value IS FRAMERATE DEPENDENT for some reason... figure it out later + // this value IS FRAMERATE DEPENDENT... todo: fix this and make this accurate #define IDLE_SLEEP_START (1 << 0) #define IDLE_MENU_START (1 << 1) #define IDLE_DIM_START (1 << 2) @@ -68,7 +70,7 @@ -const uint8_t vers[] = "241101a"; +const uint8_t vers[] = "241109a"; uint32_t cpu_use = 0; uint32_t cpu_max = 0;