Implement I2C
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
#include "ctrl_interface.hpp"
|
||||
|
||||
#include "ctrl_interface_instructions.hpp"
|
||||
|
||||
#include "FreeRTOS.h"
|
||||
#include "task.h"
|
||||
#include "queue.h"
|
||||
|
||||
void GobotRPC_CI_txCIInstructionTaskFn(void *args) {
|
||||
GobotRPC_CI *gobotRPC = (GobotRPC_CI *)args;
|
||||
gobotRPC->txCIInstructionTask();
|
||||
}
|
||||
|
||||
void GobotRPC_CI::txCIInstructionTask() {
|
||||
while(1) {
|
||||
CI_Instruction_Transport ciInstruction;
|
||||
xQueueReceive(ciInstructionQueue, &ciInstruction, portMAX_DELAY);
|
||||
|
||||
switch (ciInstruction.type) {
|
||||
case CI_INSTRUCTION_SEND_TRANMISSION_ERROR:
|
||||
uint32_t addr = ciInstruction.data[1] | (ciInstruction.data[2] << 8) | (ciInstruction.data[3] << 16) | (ciInstruction.data[4] << 24);
|
||||
uint8_t rx = ciInstruction.data[0];
|
||||
send_ErrorTransmission(rx, addr);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user