BenjaminSoelberg / openchronos-ng-elf

Fully modular opensource firmware for the eZ430 chronos using TI's new msp430-elf-gcc
GNU General Public License v3.0
59 stars 22 forks source link

Create a runloop heart beat that shows each runloop execution #48

Closed BenjaminSoelberg closed 6 years ago

BenjaminSoelberg commented 7 years ago

... say by turning the heart symbol on/off after each main loop execution. Should be a debug config option. Useful when debugging to show the freq of the runloop

quoraquestions commented 7 years ago

I had a quick stab at this, it seems that due to the high rate of runs through the main loop the symbol appears to be perpetually on :(

the change is not ready for a pull (drivers and openchronos.c references modules/dbg.h which is against openchronos design)

snapshot: https://github.com/quoraquestions/openchronos-ng-elf/commit/528fa660281335e25652a6f87747b214e198445e#diff-aa65cac55c7f6a98122f05fef93c8a2b

i was thinking we can add a debug menu where we can see the number of main loop executions/interrupts

BenjaminSoelberg commented 7 years ago

I think your problem is that you turn the segment on and off in the same run, so it is either on or off for an unequal amount of time.

I would suggest that you try xoring a bool and use that value as segment state, once for each run loop. I did that as a POC and it seemed to work just fine :-)

quoraquestions commented 7 years ago

I'll try that, looks like you mentioned we have the 20Hz timer is always up and running :S

BenjaminSoelberg commented 7 years ago

Yes, the 20 hz timer is always running which is unfortunately as the runloop is executed 20 times a sec then. Im working on some code that reduces the mainloop count to about once every sec most of the time.

BenjaminSoelberg commented 6 years ago

Side note: The 20hz timer is now only running when needed. So the mainloop is called about once every sec plus one every about 4 sec.

BenjaminSoelberg commented 6 years ago

side note: the 0.244 hz timer is now optional and the temp module now uses the 1 sec event.