ISSUIUC / TARS-Software

Illinois Space Society's flight software codebase for the TARS avionics system
https://issuiuc.github.io/flightcode-docs/classes.html
17 stars 4 forks source link

Av 827 fsm cleanup #53

Closed Jusjeev1 closed 1 year ago

Jusjeev1 commented 1 year ago

Tidying up RockerFSM. storing pointers locally for use

myersjm commented 1 year ago

uint32_t coast_timer = pointer_struct->rocketTimers.coast_timer; Does this actually get the memory address so coast_timer is a pointer? In the code, burnout_time, for example, gets assigned a value, so we need to make sure this actually goes into the memory location for the pointer struct.

Also, maybe we should name the variable coast_timer_ptr if it is a pointer so people know it is a pointer.

gautamdayal commented 1 year ago

Agree with @myersjm. Also, I think we should add an underscore to the end of each private variable name, since that's the convention and makes things a little more readable. For example, renamelaunch_timerto launch_timer_

sendhil2 commented 1 year ago

To build on what everyone else said regarding this code, the fields of the struct are used like they're references when they're just bare data. We have to have the data be pointers into where pointer struct is stored, that way the data logger can also read the data.