UBC-Rocket / WB-DAQ-Firmware

Firmware for Whistler Blackcomb's CAN/DAQ board (WB-AV-4510-CAN).
1 stars 1 forks source link

ADC Implementation cleaned #15

Closed davinbirdi closed 2 years ago

davinbirdi commented 2 years ago

Abstracted the read and setup in the RTOS Task to make simpler combining actuator and ADC tasks. Would like to know if I were to place the ADC value in a variable, how would I access it from other tasks?

Qs: Are my function naming conventions correct,

davinbirdi commented 2 years ago

Also we can probably squash and merge so the commits I made while developing don't get moved over to the main branch.

davinbirdi commented 2 years ago

@misprit7 Can you verify that it will be OK to resolve these merge conflicts by combining the differences (i.e. remove the arrows and ===s) so that the ADC library is just added to the currently existing I2C, SPI, etc...

davinbirdi commented 2 years ago

Resolved Merge Conflicts. Points to Note:

davinbirdi commented 2 years ago

Currently build, compiles, but gets fails to create tcTask

Is this a problem if the I2C is not active in the Pin Layout?

image
davinbirdi commented 2 years ago

Restarted Board - tcTask works fine. Not certain of the issue. Discussed with Xander and will note if it occurs again.

davinbirdi commented 2 years ago

adc-clean has an error reading from the ADC that I didn't catch, need to fix before merging and will do this Sunday

davinbirdi commented 2 years ago

ADC Working reading voltages, I cleaned up the issue where 2 weeks ago it wasn't reading properly after cleaning up the code.

Next issue is getting Printf to print floats.

davinbirdi commented 2 years ago

Also this does not necessarily have to be merged onto main, we can leave the branch hanging for development purposes since we will not be running an ADC off of the CAN Test points on the final product

misprit7 commented 2 years ago

Wait isn't this a dependency of the P-controller that works though, which should probably be in main? Given how much stuff is in here I think it might make more sense to merge this, and when we switch ADCs everything built on top of the ADC reads should still work.

davinbirdi commented 2 years ago

Yes it is, but do you think it's ok that we will undo the chip ADC settings in the future? TBH it's not that difficult so I can agree that it is ok to remove it when we get the SPI ADCs to work.

My rationale is that it's not setup in the current state of main hence we don't have to worry about undoing later if we only merge into it when the SPI ADCs are reading.

The P-Controller is working on the duty-cycle branch that I branched off of adc-clean, so is not in this PR.