MC Code fully done, includes the pwm encoding for kelly#11
MC Code fully done, includes the pwm encoding for kelly#11sardormirk wants to merge 1 commit intomainfrom
Conversation
| void HAL_CAN_RxFifo0MsgPendingCallback(CAN_HandleTypeDef *hcan) | ||
| { | ||
| if(hcan->Instance == CAN1){ | ||
| osSemaphoreRelease(MCSemReceiveHandle); |
There was a problem hiding this comment.
so ur reducing the work done in the ISR and signaling another thread to pick up the message. Design seems fine but curious as to the reason
| end_frame.rtr = 1; //Configure the request transmission bit to high | ||
|
|
||
| uint8_t received = 0; | ||
| void MC_ReceiveCommandThread(void *argument) { |
There was a problem hiding this comment.
low key curious as to what we gain here by even having the 2 threads instead of just 1 loop without RTOS lol. We would save out on semaphore, mutex, and general RTOS overhead. We legit have to wait for receive thread to complete and then run control thread after anyways bc of the semaphore.
There was a problem hiding this comment.
I guess, in the scenario where you have commands in rapid succession, having the receive thread at higher priority would allow for it to stay active and change the command instead of us rapidly switching modes on the pod
TharunGaneshram14
left a comment
There was a problem hiding this comment.
didn't stare too hard at your timer logic but overall seems legit
Changed/Fixed MC code for interfacing with the Kelly:
How it works:
Two tasks
5 Commands:
MC_IDLE, MC_START, MC_STOP, MC_THROTTLE, MC_DIRECTION
Builds successfully but not tested on hardware yet