Skip to content

Heinz/can rx#9

Open
Heinzino wants to merge 29 commits into
masterfrom
Heinz/CanRx
Open

Heinz/can rx#9
Heinzino wants to merge 29 commits into
masterfrom
Heinz/CanRx

Conversation

@Heinzino
Copy link
Copy Markdown
Member

@Heinzino Heinzino commented Jan 8, 2025

  • On IOC enabled interrupts on CAN_INT, CAN_RX0BUF, CAN_RX1BUF to have callback functions
    -Overwrote the callback function in CanRx
    -In CanRX added a new queue to push these commands
    -For now, when we receive a command it prints that we received it on the serial. Will have to adjust later once we know the format of the CAN message

@Heinzino Heinzino requested a review from MacKante January 8, 2025 22:11
Comment thread Components/Debug/DebugTask.cpp Outdated
}

//-- CAN Commands --
else if (strcmp(msg, "can_lights_input") == 0) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You'll likely have to increase DEBUG_RX_BUFFER_SZ_BYTES

Comment thread Components/Debug/DebugTask.cpp Outdated
// Echo the message (without the 'echo')
CUBE_PRINT("\n%s", &msg[5]);
}
else if (strncmp(msg, "readAccel ", 5) == 0) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The strncmp section is mainly for when there's something to be read after the first part of the command.

Here the third arg to strncmp is the length of bytes to compare, e.g. if you have "readAccel x" as a input, then it should be 10 (strlen("readAccel "))

Comment thread Components/CANRx/CanRxTask.hpp Outdated
CANRxTask(); // Private constructor
CANRxTask(const CANRxTask&); // Prevent copy-construction
CANRxTask& operator=(const CANRxTask&); // Prevent assignment
Queue* CAN_RX_QUEUE;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this queue actually getting allocated? Recommend using the qEvtQueue for the primary task queue (the queue the task blocks on), since all interfaces in Task.hpp point to that

HI = HIGH,

INPUT = 1,
INPUT = 2,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this work? Should break the register alignment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants