generated from hulk/gd32e23x_template
添加输出开关,M1指令开启输出,M2指令关闭输出
This commit is contained in:
parent
b3dea747d0
commit
742ede30d4
@ -9,7 +9,7 @@
|
|||||||
|
|
||||||
// #define DEBUG_VERBOES
|
// #define DEBUG_VERBOES
|
||||||
|
|
||||||
#define RS485_MAX13487
|
// #define RS485_MAX13487
|
||||||
|
|
||||||
// #define DEBUG_VOFA_TOOL
|
// #define DEBUG_VOFA_TOOL
|
||||||
|
|
||||||
|
@ -42,7 +42,7 @@ int main(void) {
|
|||||||
|
|
||||||
while (1) {
|
while (1) {
|
||||||
|
|
||||||
delay_ms(1000);
|
delay_ms(10);
|
||||||
fwdgt_counter_reload();
|
fwdgt_counter_reload();
|
||||||
if (g_statusSwitch)
|
if (g_statusSwitch)
|
||||||
{eddy_current_value_report();}
|
{eddy_current_value_report();}
|
||||||
|
@ -89,15 +89,12 @@ void process_command(uint8_t *cmd, size_t length) {
|
|||||||
// printf("%d", length);
|
// printf("%d", length);
|
||||||
sprintf(combined_str, "%c%c", cmd[3], cmd[4]);
|
sprintf(combined_str, "%c%c", cmd[3], cmd[4]);
|
||||||
if (strcmp(combined_str, "M1") == 0) {
|
if (strcmp(combined_str, "M1") == 0) {
|
||||||
printf("ok");
|
|
||||||
g_statusSwitch = true;
|
g_statusSwitch = true;
|
||||||
// eddy_current_value_report();
|
|
||||||
} else if (strcmp(combined_str, "M2") == 0) {
|
} else if (strcmp(combined_str, "M2") == 0) {
|
||||||
g_statusSwitch = false;
|
g_statusSwitch = false;
|
||||||
// tempture_value_report();
|
|
||||||
} else if (strcmp(combined_str, "M3") == 0) {
|
} else if (strcmp(combined_str, "M3") == 0) {
|
||||||
printf("%c%c%c%c%c%c", 0xB5, 0xF1, 0x02, 0x6F, 0x6B, 0xCC);
|
printf("%c%c%c%c%c%c", 0xB5, 0xF1, 0x02, 0x6F, 0x6B, 0xCC);
|
||||||
// fwdgt_reset_mcu();
|
fwdgt_reset_mcu();
|
||||||
} else {
|
} else {
|
||||||
printf("%c%c%c%c%c%c%c", 0xB5, 0xF0, 0x03, 0x65, 0x72, 0x72, 0x3C);
|
printf("%c%c%c%c%c%c%c", 0xB5, 0xF0, 0x03, 0x65, 0x72, 0x72, 0x3C);
|
||||||
return;
|
return;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user