Обновление
This commit is contained in:
parent
f63028acad
commit
f3e0fa554b
|
|
@ -28,12 +28,33 @@ static _Noreturn void Mma_Thread(tMma *env) {
|
|||
// Запуск устройства
|
||||
Mma_InitStage(env);
|
||||
|
||||
can_rx_message_type frame_data;
|
||||
|
||||
for (;;) {
|
||||
|
||||
uint16_t len = env->canPorts->Can0_IO.receive(env->canPorts->Can0_IO.env, 0, (uint8_t *)&frame_data, 1, 1000);
|
||||
|
||||
if (len > 0) {
|
||||
|
||||
if (frame_data.id_type == FLEXCAN_ID_STD) {
|
||||
CanSerialPortFrameSetType(env->canPorts->Can0_IO.env, FLEXCAN_ID_STD);
|
||||
CanSerialPortFrameSetId(env->canPorts->Can0_IO.env, frame_data.standard_id);
|
||||
} else {
|
||||
CanSerialPortFrameSetType(env->canPorts->Can0_IO.env, FLEXCAN_ID_EXT);
|
||||
CanSerialPortFrameSetId(env->canPorts->Can0_IO.env, frame_data.extended_id);
|
||||
}
|
||||
|
||||
|
||||
env->canPorts->Can0_IO.transmit(env->canPorts->Can0_IO.env, frame_data.data, frame_data.dlc, 1000);
|
||||
}
|
||||
|
||||
|
||||
//uint8_t data[8] = {'1', '2', '3', '4', '5', '6', '7', '8'};
|
||||
//env->canPorts->Can0_IO.transmit(env->canPorts->Can0_IO.env, data, 8, 0);
|
||||
|
||||
// GpioPinSet(&env->gpios->Led.ledR, true);
|
||||
SystemDelayMs(500);
|
||||
//SystemDelayMs(500);
|
||||
// GpioPinSet(&env->gpios->Led.ledR, false);
|
||||
SystemDelayMs(500);
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ void Mma_InitComIntLog(tMma *env) {
|
|||
0,
|
||||
&SERIAL_PORTS.cliVirtualPortOut_Io,
|
||||
&SERIAL_PORTS.SerialPortLog_IO,
|
||||
NULL,
|
||||
&env->rtcs->rtcI0,
|
||||
SERIAL_LOGGER_SHOW_AUTHOR | SERIAL_LOGGER_SHOW_LOG_LEVEL,
|
||||
1000
|
||||
);
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ void InitPeripheralInterfaces() {
|
|||
// Gpios_Init();
|
||||
// Adcs_Init();
|
||||
SerialPorts_Init();
|
||||
// CanPorts_Init();
|
||||
CanPorts_Init();
|
||||
Rtcs_Init();
|
||||
// StorageOnFlash_Init();
|
||||
// Pwms_Init();
|
||||
|
|
|
|||
Loading…
Reference in New Issue