Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified CM4/RemoteProc/WildhornAV_CM4.elf.bz2
Binary file not shown.
13 changes: 10 additions & 3 deletions CM4/ert/driver/can.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#include <od/od.h>
#include <device/device.h>
#include <feedback/led.h>
#include <feedback/debug.h>

/**********************
* CONSTANTS
Expand Down Expand Up @@ -144,7 +145,9 @@ util_error_t can_handle_data(device_interface_t * can_if) {
frame.data_id = rxHeader.Identifier >> CAN_DATAID_OFFSET;
uint8_t source = rxHeader.Identifier & CAN_BOARDID_MASK;

od_handle_can_frame(source, &frame);
debug_log("CAN Received: %x\n", source);

//od_handle_can_frame(source, &frame);

}
return ER_SUCCESS;
Expand Down Expand Up @@ -270,13 +273,17 @@ void can_transmit_thread(__attribute__((unused)) void *arg) {
while(1) {
// retrieve next frame
od_frame_t frame;
od_pop_from_out_q(&frame);
od_push_to_in_q(&frame);

frame.data[0] = 35;
//od_pop_from_out_q(&frame);
//od_push_to_in_q(&frame);

led_checkpoint(checkpoint_tx);

// send over CAN
device_interface_send(&fdcan1_interface, (uint8_t *) &frame, sizeof(od_frame_t));

osDelay(1000);
}
}

Expand Down
6 changes: 3 additions & 3 deletions CM4/ert/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ void init(void) {
od_init();

// NOT USED DUE TO BUGS!!!!
//can_init(WH_COMPUTER);
can_init(1);

#if WH_HAS_FEEDBACK == WH_TRUE
#if WH_USE_BUZZER == WH_TRUE
Expand Down Expand Up @@ -155,9 +155,9 @@ void init(void) {
INIT_THREAD_CREATE(hostcom_handle, hostcom, hostcom_thread, NULL, HOSTCOM_SZ, HOSTCOM_PRIO);

// NOT USED DUE TO BUGS!!!!
//INIT_THREAD_CREATE(can_rx_handle, can_rx, can_receive_thread, NULL, CAN_TX_SZ, CAN_TX_PRIO);
INIT_THREAD_CREATE(can_rx_handle, can_rx, can_receive_thread, NULL, CAN_TX_SZ, CAN_TX_PRIO);
UNUSED(can_rx_handle);
//INIT_THREAD_CREATE(can_tx_handle, can_tx, can_transmit_thread, NULL, CAN_RX_SZ, CAN_RX_PRIO);
INIT_THREAD_CREATE(can_tx_handle, can_tx, can_transmit_thread, NULL, CAN_RX_SZ, CAN_RX_PRIO);
UNUSED(can_tx_handle);

#if WH_HAS_RADIO
Expand Down