Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Merged functionality of SendCarCAN into Telemetry and removed SendCarCAN remnants * renamed telemetry to send car can * adapted CAN_Queue into a library file and integrated with SendCarCAN * merge conflict resolved * Started a test file for SendCarCAN. * Changed main loop to check the queue periodically instead of pending on a semaphore. The loop will check two semaphores- one to see if it's time to put an IO State message in the queue (based on if the putIOState timer has expired or not) and one to see if there's a message in the queuethat we should send. * Deleted most putIOStateTimer thigns, added a macro and counter in the sendCarCAN loop to send the IO message at approximately the same frequency as before (250 ms), but this time using loops, delays, and counters. It won't be as accurate, but it should still be at a relatively similar frequency. * Added line to put messages from the motor into the CarCAN queue to be sent. * Altered test macros so that we can define __TEST_SENDTRITIUM and print info while running tests on hardware or also define __TEST_SENDTRITIUM_SOFTWAREONLY to bypass hardware inputs/outputs. * Made aa first draft of the SendCarCAN test file and attempted to get at the SendCarCAN file by exposing it with a macro mess. controls-leader code compiles, but the test file does not compile yet. * SendCarCAN test file compiles! But at what cost... * Cleaned up and worked on test file, removed attempt to put fifo in header file and added a wrapper instead. Test compiles but hasn't been verified to work successfully yet. * Added ability to print FIFO queue indexes, added ReadTritium task in SendCarCAN test, fixed CAN initialization to read CarCAN but also initialize MOTORCAN. * Test file updates from testing on hardware. * Deleted extra lines added when merging. * Moved mutex, semaphore creation and fifo renewal to a new SendCarCAN_Init function so that other tasks can put things into the queue before SendCarCAN is ready. Additionally, created a new static task in SendCarCAN.c called PutIOState which periodically sends messages over CarCAN. * Changed PutIOState to send directly instead of putting messages in the queue to be sent by SendCarCAN later. * Updates from hardware testing: added counter array to reduce frequency at which we forwared motor messages onto CarCAN, moved init functions in test file, added Renode independent watchdog fix. * Added while loop to putIOState * Test file changes for last minute panic debugging. Added an array to see what IDS are being received. * Addressing review comments: updated SendTritium macros, removed motorMsgCount queue, downsized SendCarCAN FIFO. * Revisions to SendCarCAN and test file to allow messages to be inspected in GDB using variables instead of prints which were overwhelming UART. * Updated NUM_CAN_IDS to MAX_CAN_ID in the CANId enum. * Added commas to enum to match new enum generation format. * Memset the gTxMessage.Data to zero since one-byte messages weren't clearing out old data in the rest of the bytes, updated comments in the test file. * Fixed accidental deletion in docs. * Changes from integration with BPS: flipped reading of ignition pins in PutIOState to account for the inverted logic, added a new bit of information to PutIOState in byte 3, bit 2 which tells BPS if the array contactor should be turned on or not (true if IGN_1 or IGN_2 are on). This is necessary because when the ignition is switched to motor state, the array pin is turned off (only one or the other is on at a time). Note: in the future we'd like to use the GPIO read settings to account for the inverted ignition logic so we don't have to negate every Minions_Read. * Addressed review comments: Shifted task priorities to be next to each other, added to the comment for SendCarCAN_Put. * addressed review comments --------- Co-authored-by: ishdeshpa <[email protected]> Co-authored-by: Madeleine Lee <[email protected]>
- Loading branch information