|
|
@ -23,6 +23,7 @@ |
|
|
|
#include "sdk\components\zcan_module\zcan_trigle_warning_light_ctl_module.hpp"
|
|
|
|
//
|
|
|
|
#include "sdk\components\zcan_module\zcan_high_power_electrical_ctl_module.hpp"
|
|
|
|
#include "sdk\components\zcan_module\zcan_m211887_module_manager.hpp"
|
|
|
|
|
|
|
|
#define TAG "main"
|
|
|
|
namespace iflytop { |
|
|
@ -47,9 +48,13 @@ ZGPIO AirBlowerCtrl2; |
|
|
|
ZGPIO HeatingStripCtrl1; |
|
|
|
ZGPIO HeatingStripCtrl2; |
|
|
|
|
|
|
|
ZGPIO output8; |
|
|
|
ZGPIO output9; |
|
|
|
|
|
|
|
ZCanReceiver m_canReceiver; |
|
|
|
ZCanBasicOrderModule m_basicOrderModule; |
|
|
|
ZCanHighPowerElectricalCtlModule m_highPowerElectricalCtlModule; |
|
|
|
ZCanM211887ModuleManager m_m211887ModuleManager; |
|
|
|
|
|
|
|
void Main::onRceivePacket(CanPacketRxBuffer *rxbuf, uint8_t *packet, size_t len) { |
|
|
|
printf("can rx from %d %d,", rxbuf->id, len); |
|
|
@ -83,14 +88,17 @@ void Main::run() { |
|
|
|
HeatingStripCtrl1.initAsOutput(PC6, ZGPIO::kMode_nopull, true, false); |
|
|
|
HeatingStripCtrl2.initAsOutput(PC7, ZGPIO::kMode_nopull, true, false); |
|
|
|
|
|
|
|
ZHAL_CORE_REG(3000, { |
|
|
|
AirCompressorCtrl1.toggleState(); |
|
|
|
AirCompressorCtrl2.toggleState(); |
|
|
|
AirBlowerCtrl1.toggleState(); |
|
|
|
AirBlowerCtrl2.toggleState(); |
|
|
|
HeatingStripCtrl1.toggleState(); |
|
|
|
HeatingStripCtrl2.toggleState(); |
|
|
|
}); |
|
|
|
output8.initAsOutput(PD13, ZGPIO::kMode_nopull, true, false); |
|
|
|
output9.initAsOutput(PD14, ZGPIO::kMode_nopull, true, false); |
|
|
|
|
|
|
|
// ZHAL_CORE_REG(3000, {
|
|
|
|
// AirCompressorCtrl1.toggleState();
|
|
|
|
// AirCompressorCtrl2.toggleState();
|
|
|
|
// AirBlowerCtrl1.toggleState();
|
|
|
|
// AirBlowerCtrl2.toggleState();
|
|
|
|
// HeatingStripCtrl1.toggleState();
|
|
|
|
// HeatingStripCtrl2.toggleState();
|
|
|
|
// });
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief 基础模块 |
|
|
@ -123,6 +131,16 @@ void Main::run() { |
|
|
|
HeatingStripCtrl2.setState(val); |
|
|
|
return true; |
|
|
|
} |
|
|
|
|
|
|
|
if (id == 8) { |
|
|
|
output8.setState(val); |
|
|
|
return true; |
|
|
|
} |
|
|
|
if (id == 9) { |
|
|
|
output9.setState(val); |
|
|
|
return true; |
|
|
|
} |
|
|
|
|
|
|
|
return false; |
|
|
|
}); |
|
|
|
|
|
|
@ -142,6 +160,9 @@ void Main::run() { |
|
|
|
return false; |
|
|
|
}); |
|
|
|
|
|
|
|
// m_m211887ModuleManager.initialize(&m_canReceiver);
|
|
|
|
// m_m211887ModuleManager.regSubmodule(1, &huart3,1);
|
|
|
|
|
|
|
|
ZLOGI(TAG, "init done"); |
|
|
|
while (1) { |
|
|
|
ZHALCORE::getInstance()->loop(); |
|
|
|