19 changed files with 1528 additions and 1476 deletions
-
8sdk/components/modbus/modbus_client.hpp
-
0sdk/components/zcan_board_module/zcan_board_module.cpp
-
6sdk/components/zcan_board_module/zcan_board_module.hpp
-
24sdk/components/zcan_protocol_parser/zcan_protocol_parser.cpp
-
12sdk/components/zcan_protocol_parser/zcan_protocol_parser.hpp
-
0sdk/components/zcancmder/basic.cpp
-
7sdk/components/zcancmder/basic.hpp
-
1sdk/components/zcancmder/protocol_event_bus_sender.hpp
-
24sdk/components/zcancmder/type/zcan_rx_frame.hpp
-
40sdk/components/zcancmder/type/zcan_rx_frame_pool.hpp
-
31sdk/components/zcancmder/type/zcan_rx_frame_queue.hpp
-
90sdk/components/zcancmder/zcanreceiver.cpp
-
41sdk/components/zcancmder/zcanreceiver.hpp
-
2usrc/public_service/gservice.hpp
-
2usrc/version.h
@ -1,7 +0,0 @@ |
|||||
//
|
|
||||
// Created by zwsd
|
|
||||
//
|
|
||||
|
|
||||
#pragma once
|
|
||||
#include "a8000_protocol\protocol.hpp"
|
|
||||
#include "sdk/os/zos.hpp"
|
|
@ -0,0 +1,24 @@ |
|||||
|
//
|
||||
|
// Created by zwsd
|
||||
|
//
|
||||
|
|
||||
|
#pragma once
|
||||
|
#include "sdk/os/zos.hpp"
|
||||
|
|
||||
|
#ifdef HAL_CAN_MODULE_ENABLED
|
||||
|
namespace iflytop { |
||||
|
|
||||
|
class ZcanRxframe { |
||||
|
public: |
||||
|
uint8_t rxdata[128]; |
||||
|
int rxdataLen = 0; |
||||
|
|
||||
|
uint8_t canPacketNum = 0; |
||||
|
uint8_t npacket = 0; |
||||
|
|
||||
|
void* cxt = nullptr; |
||||
|
bool isUsed = false; |
||||
|
}; |
||||
|
|
||||
|
} // namespace iflytop
|
||||
|
#endif
|
@ -0,0 +1,40 @@ |
|||||
|
//
|
||||
|
// Created by zwsd
|
||||
|
//
|
||||
|
|
||||
|
#pragma once
|
||||
|
#include "zcan_rx_frame.hpp"
|
||||
|
|
||||
|
#ifdef HAL_CAN_MODULE_ENABLED
|
||||
|
namespace iflytop { |
||||
|
|
||||
|
class ZcanRxframePool { |
||||
|
public: |
||||
|
ZcanRxframe buf[3]; |
||||
|
|
||||
|
void init() {} |
||||
|
|
||||
|
ZcanRxframe* alloc() { |
||||
|
for (int i = 0; i < 3; i++) { |
||||
|
if (!buf[i].isUsed) { |
||||
|
buf[i].isUsed = true; |
||||
|
return &buf[i]; |
||||
|
} |
||||
|
} |
||||
|
return NULL; |
||||
|
} |
||||
|
|
||||
|
void free(ZcanRxframe** ppframe) { |
||||
|
ZcanRxframe* frame = *ppframe; |
||||
|
if (frame == NULL) return; |
||||
|
frame->isUsed = false; |
||||
|
frame->rxdataLen = 0; |
||||
|
frame->canPacketNum = 0; |
||||
|
frame->npacket = 0; |
||||
|
frame->cxt = NULL; |
||||
|
*ppframe = NULL; |
||||
|
} |
||||
|
}; |
||||
|
|
||||
|
} // namespace iflytop
|
||||
|
#endif
|
@ -0,0 +1,31 @@ |
|||||
|
//
|
||||
|
// Created by zwsd
|
||||
|
//
|
||||
|
|
||||
|
#pragma once
|
||||
|
#include "sdk/os/zos.hpp"
|
||||
|
#include "zcan_rx_frame.hpp"
|
||||
|
|
||||
|
#ifdef HAL_CAN_MODULE_ENABLED
|
||||
|
namespace iflytop { |
||||
|
|
||||
|
class ZcanRxframeQueue { |
||||
|
uint8_t queueStorage[4 * sizeof(void*)] = {0}; |
||||
|
|
||||
|
QueueHandle_t handler = nullptr; |
||||
|
StaticQueue_t xQueueBuffer; |
||||
|
|
||||
|
public: |
||||
|
void init() { handler = xQueueCreateStatic(4, sizeof(void*), queueStorage, &xQueueBuffer); } |
||||
|
|
||||
|
void sendIRQ(ZcanRxframe* frame) { xQueueSendFromISR(handler, &frame, NULL); } |
||||
|
|
||||
|
ZcanRxframe* receive() { |
||||
|
ZcanRxframe* frame = NULL; |
||||
|
xQueueReceive(handler, &frame, 0); |
||||
|
return frame; |
||||
|
} |
||||
|
}; |
||||
|
|
||||
|
} // namespace iflytop
|
||||
|
#endif
|
@ -1,2 +1,2 @@ |
|||||
#pragma once |
#pragma once |
||||
#define PC_VERSION 1020 |
|
||||
|
#define PC_VERSION 1021 |
Write
Preview
Loading…
Cancel
Save
Reference in new issue