minor comments updates

This commit is contained in:
true 2024-11-09 21:22:38 -08:00
parent 280f452f9a
commit 3d0a13dead
2 changed files with 8 additions and 5 deletions

View File

@ -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

View File

@ -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;