Skip to content

Conversation

@makejimmi
Copy link

NOTE:
The sub 700 mA were reached having the clearLeds() (see TODO commit) function. I am not entirely sure whether I should touch more files on just one brunch or not. Best keep it simple and "überschaubar für's Erste".

NOTE:
These were some quick additions of what was available on my other fork of the old FABI repo as of commit where firmware was found in that very repo as opposed to the new system (hardware and firmware have their respective repos).
Take it with a grain of salt.

…sing global flag = goingDormant

this flag can be used to signal other processes that dormant should be prepared for
src: gpio.h: function prototype of clearLeds(), this is to save more juice

src: gpio.cpp: implement clearLeds()

src: lpwfuncs.cpp: add soft startup function
@makejimmi makejimmi closed this Jul 29, 2025
@makejimmi
Copy link
Author

I'd like you to review this @ChrisVeigl

Lg, Jimmi :)

@makejimmi makejimmi reopened this Jul 29, 2025
Copy link
Contributor

@ChrisVeigl ChrisVeigl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hi! thanks for the pull request!
I have some questions regarding what is really necessary / eventually missing ...
BTW: thanks for support for multiple wakeup pins! - I integrated that already "manually" ..

Serial.end();
displayMessage((char*)"ByeBye");
delay(2000); // time for the user to read the message
disable3V3(); // shut down peripherals
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isn't this essential ??
it shuts down the power supply external loads ...
where is this in your code - or why was it removed?

dormantUntilInterrupt(input_map, NUMBER_OF_PHYSICAL_BUTTONS); // enter sleepMode, use input_map pins to wakeup!
// <-- now sleeping!

cyw43_arch_init();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure if / why this is needed ... shouldn't the cyw43 come up normally after the watchdog reset?

digitalWrite(pin, LOW);
pinMode(pin, INPUT);
digitalWrite(pin, LOW);
delay(5);
Copy link
Contributor

@ChrisVeigl ChrisVeigl Sep 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is there an important difference? - why not keep the low-level functions?
is the delay really needed?
why are these specific pins skipped?

memset(device_list,0,8);

while(supported_devices[devicenr] != 0x00) { //test until address is 0x00
while(supported_devices[devicenr] != 0x00 && !goingDormant) { //test until address is 0x00
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is the goingDormant flag needed? did the I2C access interfere with sleep mode activation? should we add a function instead to activate / suspend I2C access?

}
if (Wire1.available()) {
Wire1.flush(); delay(10); Wire1.endTransmission(); delay(10); Wire1.end(); delay(100);
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe put that in a dedicated function, and into a module than handles I2C init / testing / deactivation?

Did you find that shutting down Wire and Wire1 significantly reduces power consumption during sleep?


void initDormant() {
goingDormant = true;
delay(2000);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we remove this delay?
(initially we had a 2 sec delay to be able to read the "byeBye"-message on the display.
I think it makes more sense to signal the sleep mode using a tone sequence (maybe the startup tones reversed?)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants