|
|
@ -41,7 +41,33 @@ void ZCanPumpCtrlModule::onRceivePacket(CanPacketRxBuffer* rxbuf, uint8_t* packe |
|
|
|
int16_t acc = *(int16_t*)(&cmdheader->data[2]); |
|
|
|
int16_t rpm = *(int16_t*)(&cmdheader->data[4]); |
|
|
|
|
|
|
|
subm->m_pumprun_fn(acc, rpm); |
|
|
|
subm->m_pumprun_fn(acc, rpm, -1, -1); |
|
|
|
|
|
|
|
uint8_t txbuff[1] = {}; |
|
|
|
txbuff[0] = id; |
|
|
|
m_zcanReceiver->sendAck(cmdheader, txbuff, sizeof(txbuff)); |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if (cmdheader->cmdid == kcmd_peristaltic_pump_ctl && cmdheader->subcmdid == 1) { |
|
|
|
/**
|
|
|
|
* @brief |
|
|
|
* cmd: |
|
|
|
* [0]:蠕动泵ID |
|
|
|
* [2:3]:acc [4:5]:转速rpm [6]: 功率 |
|
|
|
* ack : b0:pumpid |
|
|
|
* ack_datalen : 1 |
|
|
|
*/ |
|
|
|
uint8_t id = cmdheader->data[0]; |
|
|
|
Submodule* subm = find(id); |
|
|
|
if (subm) { |
|
|
|
int16_t acc = *(int16_t*)(&cmdheader->data[2]); |
|
|
|
int16_t rpm = *(int16_t*)(&cmdheader->data[4]); |
|
|
|
int16_t idlepower = cmdheader->data[6]; |
|
|
|
int16_t power = cmdheader->data[7]; |
|
|
|
|
|
|
|
subm->m_pumprun_fn(acc, rpm, idlepower, power); |
|
|
|
|
|
|
|
uint8_t txbuff[1] = {}; |
|
|
|
txbuff[0] = id; |
|
|
|