Browse Source
Merge branch 'master' of 192.168.1.3:p_transmit_disinfection_v3/transmit_disinfection_micro
moveToEndTestVersion
Merge branch 'master' of 192.168.1.3:p_transmit_disinfection_v3/transmit_disinfection_micro
moveToEndTestVersion
8 changed files with 74 additions and 61 deletions
-
7README.md
-
2app_protocols/zscanprotocol
-
2stm32components
-
33ucomponents/preportional_valve/preportional_valve_ctrl.cpp
-
2usrc/module/blower_controller.hpp
-
44usrc/module/proportional_valve_ctrl.cpp
-
43usrc/module/proportional_valve_ctrl.hpp
-
2usrc/project_configs.h
@ -1 +1 @@ |
|||||
Subproject commit d11d41c1062568f629d5ec2bc6435319b7ea83e3 |
|
||||
|
Subproject commit 8a3aeaf8883a3c7d01594e0399fbe96bf8b9cf72 |
@ -1 +1 @@ |
|||||
Subproject commit 03d9638ccbc69971524957a68e51842da0960940 |
|
||||
|
Subproject commit b3cae2e4945639f0148a5e3034b039f5679151e3 |
@ -0,0 +1,44 @@ |
|||||
|
#include "proportional_valve_ctrl.hpp"
|
||||
|
|
||||
|
using namespace iflytop; |
||||
|
using namespace transmit_disfection_protocol; |
||||
|
|
||||
|
void ProportionalValveCtrl::initialize(UART_HandleTypeDef* huart) { |
||||
|
valve.initialize(huart); |
||||
|
m_isInitialized = true; |
||||
|
|
||||
|
BIND_FN(ProportionalValveCtrl, this, fn_proportional_set_valve); |
||||
|
BIND_FN(ProportionalValveCtrl, this, fn_proportional_read_pos); |
||||
|
BIND_FN(ProportionalValveCtrl, this, fn_proportional_is_busy); |
||||
|
} |
||||
|
|
||||
|
bool ProportionalValveCtrl::isInitialized() { return m_isInitialized; } |
||||
|
|
||||
|
void ProportionalValveCtrl::fn_proportional_set_valve(ProcessContext* cxt) { |
||||
|
int32_t err = valve.setValvePos(GET_PARAM(0), GET_PARAM(1)); |
||||
|
if (err) { |
||||
|
zcanbus_send_errorack(cxt->packet, err); |
||||
|
} else { |
||||
|
zcanbus_send_ack(cxt->packet, NULL, 0); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
void ProportionalValveCtrl::fn_proportional_read_pos(ProcessContext* cxt) { |
||||
|
int32_t pos = 0; |
||||
|
int32_t err = valve.getValvePos(GET_PARAM(0), &pos); |
||||
|
if (err) { |
||||
|
zcanbus_send_errorack(cxt->packet, err); |
||||
|
} else { |
||||
|
zcanbus_send_ack(cxt->packet, (uint8_t*)&pos, sizeof(pos)); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
void ProportionalValveCtrl::fn_proportional_is_busy(ProcessContext* cxt) { |
||||
|
int32_t busy = 0; |
||||
|
int32_t err = valve.isBusy(GET_PARAM(0), &busy); |
||||
|
if (err) { |
||||
|
zcanbus_send_errorack(cxt->packet, err); |
||||
|
} else { |
||||
|
zcanbus_send_ack(cxt->packet, (uint8_t*)&busy, sizeof(busy)); |
||||
|
} |
||||
|
} |
Write
Preview
Loading…
Cancel
Save
Reference in new issue