generated from hulk/gd32e23x_template_cmake_vscode
new project
This commit is contained in:
23
Src/main.c
23
Src/main.c
@@ -40,6 +40,9 @@ OF SUCH DAMAGE.
|
||||
#include <stdio.h>
|
||||
#include "i2c.h"
|
||||
#include "board_config.h"
|
||||
#include "ultrasonic_analog.h"
|
||||
|
||||
volatile uint16_t g_capture_value;
|
||||
|
||||
/*!
|
||||
\brief main function
|
||||
@@ -49,12 +52,14 @@ OF SUCH DAMAGE.
|
||||
*/
|
||||
int main(void)
|
||||
{
|
||||
|
||||
setbuf(stdout, NULL);
|
||||
|
||||
systick_config();
|
||||
|
||||
rs485_init();
|
||||
|
||||
led_init();
|
||||
ultrasonic_config();
|
||||
|
||||
#ifdef DEBUG_VERBOSE
|
||||
char hello_world[] = {"Hello World!\r\n"};
|
||||
@@ -68,16 +73,16 @@ int main(void)
|
||||
while (usart_flag_get(RS485_PHY, USART_FLAG_TC) == RESET) {}
|
||||
#endif
|
||||
|
||||
i2c_config();
|
||||
|
||||
#ifdef DEBUG_VERBOSE
|
||||
i2c_scan();
|
||||
|
||||
i2c_bus_reset();
|
||||
#endif
|
||||
|
||||
while(1){
|
||||
|
||||
// ultrasonic_pwm_out_cycles();
|
||||
|
||||
// delay_ms(10);
|
||||
command_process();
|
||||
delay_ms(10);
|
||||
delay_ms(10);
|
||||
// uint16_t ultrasonic_value = ultrasonic_calc_distance();
|
||||
// printf("ultrasonic value: %d", ultrasonic_value);
|
||||
// delay_ms(10);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user