the oled display rotates when the addon is physically rotated, so that menus are upright. now the user buttons will remap as well. this was done in the old code...or so I thought, but I can't find the code that did it.
needed to implement clock stretching on start/stop routines too.
program tick timer on sub MCU doesn't really need to be highest priority so made i2c higher priority.
buttons are now somewhat working properly, but register 0x12 (button debounce value) keeps getting overwritten / corrupted. once this is fixed then buttons will likley work properly.
fixed i2c routine usage throughout the code.
clock speed increased as rendering was taking too long.
fixed aw20xxx LED enable code (I think).
now handling buttons, though still having some problems.
running even more code from RAM.
using less EEPROM for config as we don't need it. hell we don't even need the pages we have.
OLED is now rendering "Supercon" text.
Moved several functions to RAM to speed up operation. There is a significant speed hit when executing from Flash on this MCU.
CH58x/CH59x only has one main system clock and all timers are referenced to this clock. Other than watchdog, there's only one timer that runs independently: RTC. Thankfully the RTC has a mode to interrupt at rates faster than one second. this is being used for the program tick interrupt.
Also added OLED initialization code since that was forgotten before.
will it work? almost certainly not. but it does build cleanly now.
lightsense is stubbed for the time being.
rgbled does _not_ render the programs. I am going to redo how this works. the data (which will be empty) is sent though.
the module originally made assumptions about devices always using every row, even though code was in place to sort of look for that. Hopefully fixed those bugs so AW20054, which only has 9 rows, or any other chip when using less than 12 rows will work.
vendor accelerometer library is added, and initial code to use it has also been adapted from an example. this is incomplete; need to implement interrupts if using them. for now this may be just enough to work in polled mode.
many things are different from WP DC29, including but not limited to:
- different vendor and core
- different peripherals
- no external serial number MCU, now have different i2c-communicated MCU
- different accelerometer
- different RGBLED count
- RGBLED controller instead of PWM controller
- soft I2C instead of hard I2C
- I2C EEPROM instead of SPI Flash
code has been "cleaned up" and some work done for porting. the code "builds" but most of the render code isn't actually used yet. there's still a lot to fix between render, UI, and incomplete implementations.