Update some comments

This commit is contained in:
Ondrej Jirman 2021-06-16 14:44:18 +02:00
parent 2e29c24145
commit b9b02a5e73
1 changed files with 7 additions and 3 deletions

View File

@ -270,6 +270,9 @@ static uint8_t i2c_regs[I2C_N_REGS] = {0xaa, 0x55};
static uint8_t i2c_cmd[I2C_N_REGS]; static uint8_t i2c_cmd[I2C_N_REGS];
static uint8_t i2c_cmd_len = 0; static uint8_t i2c_cmd_len = 0;
//XXX: how to determine end of I2C transaction from the interrupt?
//XXX: we need this to be able to determine when it's safe to go back to sleep/power down
void i2c_b_interupt(void) __interrupt(IRQ_I2CB) void i2c_b_interupt(void) __interrupt(IRQ_I2CB)
{ {
uint8_t saved_page = PAGESW; uint8_t saved_page = PAGESW;
@ -410,11 +413,12 @@ void main(void)
//uint16_t ticks = 0; //uint16_t ticks = 0;
while (1) { while (1) {
if (!run_tasks) { if (!run_tasks) {
// power down // power down (timers don't work in power-down)
//PCON |= BIT(1); //PCON |= BIT(1);
// go to idle CPU mode when there's nothing to do (doesn't help much)
// go to idle CPU mode when there's nothing to do // switching to LOSC may work better
//PCON |= BIT(0); //PCON |= BIT(0);
__asm__("nop"); __asm__("nop");
continue; continue;
} }