|
@ -71,7 +71,8 @@ void setmotor(TMC5130 *motor, int16_t acc_rpm2, int16_t rpm, int16_t idlepower, |
|
|
motor->rotate(ppm); |
|
|
motor->rotate(ppm); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
void Hardware::initialize() { |
|
|
|
|
|
|
|
|
void Hardware::initialize(int deviceId) { |
|
|
|
|
|
m_device_id = deviceId; |
|
|
IO_PD13_IN.initAsInput(PD13, ZGPIO::kMode_nopull, ZGPIO::kIRQ_noIrq, false /*mirror*/); |
|
|
IO_PD13_IN.initAsInput(PD13, ZGPIO::kMode_nopull, ZGPIO::kIRQ_noIrq, false /*mirror*/); |
|
|
IO_PC7_IN.initAsInput(PC7, ZGPIO::kMode_nopull, ZGPIO::kIRQ_noIrq, false /*mirror*/); |
|
|
IO_PC7_IN.initAsInput(PC7, ZGPIO::kMode_nopull, ZGPIO::kIRQ_noIrq, false /*mirror*/); |
|
|
|
|
|
|
|
@ -136,6 +137,15 @@ int32_t Hardware::process_rx_packet(from_where_t fromwhere, uint8_t *packet, int |
|
|
Cmdheader_t *cmdheader = (Cmdheader_t *)packet; |
|
|
Cmdheader_t *cmdheader = (Cmdheader_t *)packet; |
|
|
|
|
|
|
|
|
/**
|
|
|
/**
|
|
|
|
|
|
* @brief Ping |
|
|
|
|
|
*/ |
|
|
|
|
|
PROCESS_CMD(kcmd_ping, m_device_id) { |
|
|
|
|
|
receipt[0] = cmdheader->data[0]; |
|
|
|
|
|
receiptsize = 1; |
|
|
|
|
|
return 0; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
* @brief 获取蒸发仓水浸状态 |
|
|
* @brief 获取蒸发仓水浸状态 |
|
|
*/ |
|
|
*/ |
|
|
PROCESS_CMD(kcmd_proportional_read_water_immersion_sensor, 0) { |
|
|
PROCESS_CMD(kcmd_proportional_read_water_immersion_sensor, 0) { |
|
|