theAgingApprentice / HexaFloorRide

Arduino based six legged robot project
MIT License
0 stars 0 forks source link

Implement new header file standards #93

Open nerdoug opened 1 year ago

nerdoug commented 1 year ago

Issue 43 describes the standard we've decided to adopt for header files, which is summarized in a diagram in /docs/header-files.pdf . This issue (93) records the need to implement changes to conform to our new standard. Rather than have this ticket close every time I upload modified files, I'm going to try and sneak updates into git using temporary branches of the form headerN. With comments in this issue.

nerdoug commented 1 year ago

branch header2 about to be merged with first stage of implementing new header conventions -did a backup of hexafloorride project before making changes

nerdoug commented 1 year ago

Have had to change the the order of certain sections in main.cpp, because some sections require other sections to have already been compiled. Note that the order of compilation is different than the order of code execution at startup.

I'm going to expand the documentation for the header file standards, and do it in the slightly easier LO writer format.

At this point I've done 4 git merges for this, called header1 through header4. Along the way, I've snuck in skeletal support for a generalized console/MQTT trace facility, but I'm going to separate that into it's own issue, and branch set.

nerdoug commented 1 year ago

latest header file standards will be documented in /docs/header-file-standards.pdf

nerdoug commented 1 year ago

There are a couple of areas in the header standards that we need to discuss, highlighted by multiple question marks in /docs/header-file-standards.pdf

nerdoug commented 1 year ago

The implementation of the new header standards included some cleanup of old unused code. I removed servoLegs.cpp which we don't use, but which was being initialized. Turns out we needed the initialization code for PCA9685 which was missing from the new stuff that replaced servoLegs. Migrated the initialization code into a new module called deviceSupport.cpp, with a possible plan to consolidate device support for I2C, Oled, RGBled, battery measurement, sensors, etc. Think we should move away from having a library for each function, to having similar functions grouped in a "bag", but open to discussions.

fixed code will be in branch issue93b, which I'll create after I recover from the changes I made to main.

nerdoug commented 1 year ago

leg code is fixed, and header-files-standard.pdf has been updated per our discussion, and merged to git. There are still lots of source files that don't quite follow the new standards, but I'm going to let that happen as we work on the files for other reasons, and close issue 93