Closed Jusjeev1 closed 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.
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_timer
to launch_timer_
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.
Tidying up RockerFSM. storing pointers locally for use