Compare commits

..

No commits in common. "c9e994f0c280da690d3969b1e46116ac71c3686f" and "1752e3824c8f56ecdf81e5d1e6df778cd138184f" have entirely different histories.

6 changed files with 11 additions and 17 deletions

View File

@ -5,11 +5,11 @@
#ifndef BOARD_CONFIG_H #ifndef BOARD_CONFIG_H
#define BOARD_CONFIG_H #define BOARD_CONFIG_H
// #define SOFTWARE_IIC #define SOFTWARE_IIC
// #define DEBUG_VERBOES // #define DEBUG_VERBOES
// #define RS485_MAX13487 #define RS485_MAX13487
// #define DEBUG_VOFA_TOOL // #define DEBUG_VOFA_TOOL

View File

@ -19,7 +19,7 @@
/******************************************************************************/ /******************************************************************************/
#define I2C_SPEED 100*(1000) #define I2C_SPEED 20000
#define I2C_TIME_OUT (uint16_t)(5000) #define I2C_TIME_OUT (uint16_t)(5000)
#define I2C_OK 1 #define I2C_OK 1

View File

@ -36,7 +36,6 @@ OF SUCH DAMAGE.
#define MAIN_H #define MAIN_H
#include <stdio.h> #include <stdio.h>
#include <stdbool.h>
#include "gd32e23x.h" #include "gd32e23x.h"
#include "systick.h" #include "systick.h"
#include "gd32e23x_libopt.h" #include "gd32e23x_libopt.h"

View File

@ -9,7 +9,6 @@
#include "gd32e23x.h" #include "gd32e23x.h"
#include "systick.h" #include "systick.h"
#include <stdio.h> #include <stdio.h>
#include <stdbool.h>
#include "ldc1612.h" #include "ldc1612.h"
#include "tmp112.h" #include "tmp112.h"
#include "fwdgt.h" #include "fwdgt.h"

View File

@ -6,8 +6,6 @@
*/ */
#include "main.h" #include "main.h"
bool g_statusSwitch = false;
/*! /*!
\brief main function \brief main function
\param[in] none \param[in] none
@ -42,10 +40,8 @@ int main(void) {
while (1) { while (1) {
delay_ms(10); // delay_ms(10);
fwdgt_counter_reload(); fwdgt_counter_reload();
if (g_statusSwitch)
{eddy_current_value_report();}
} }
} }

View File

@ -7,8 +7,6 @@
uint8_t package_header[3] = {0xB5, 0xF0, 0x04}; uint8_t package_header[3] = {0xB5, 0xF0, 0x04};
uint8_t package_data[4] = {0}; uint8_t package_data[4] = {0};
extern bool g_statusSwitch;
void rs485_config(void) { void rs485_config(void) {
#ifndef RS485_MAX13487 #ifndef RS485_MAX13487
rcu_periph_clock_enable(RS485_GPIO_RCU); rcu_periph_clock_enable(RS485_GPIO_RCU);
@ -89,11 +87,13 @@ 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) {
g_statusSwitch = true; eddy_current_value_report();
} else if (strcmp(combined_str, "M2") == 0) { } else if (strcmp(combined_str, "M2") == 0)
g_statusSwitch = false; {
} else if (strcmp(combined_str, "M3") == 0) { tempture_value_report();
printf("%c%c%c%c%c%c", 0xB5, 0xF0, 0x02, 0x6F, 0x6B, 0xCC); } else if (strcmp(combined_str, "M3") == 0)
{
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);