gcormier / megadesk

Open-source IKEA Bekant controller board
GNU General Public License v3.0
719 stars 53 forks source link

Serial Ss:save W:write & Error responses #71

Closed philwmcdonald closed 3 years ago

philwmcdonald commented 3 years ago

Replaced W serial command with S (Store/Save) and new down-button variant 's'. W now writes arbitrary data - allowing erase of eeprom slots, which wasn't possible before. Added little L 'l' as the down-button L command.

Introduced serial error responses. They look like: >E9000,0 Indicating an error with either position 9000, or slot 0.

See the serial_tests.txt file for example commands and responses including commands with errors.

Recalibration was slightly broken after #70. recalibration worked, but afterwards manual-up refused to move the desk into "danger-zone" (memory recall allows getting out of this condition). Fixed manual buttons to recover whenever desk is out of regular working range.

Recalibration would also get stuck if motors bottomed-out at position <99. Something that happens on one of my desks.

Image size savings via fewer comparisons in button-handling.

Added a serial-commands example file.

Simplified/refactored targetHeight handling further for more image size savings.

Further tiding/comments.

With all features enabled:

RAM:   [======    ]  56.1% (used 287 bytes from 512 bytes)
Flash: [==========]  99.4% (used 8140 bytes from 8192 bytes)