generated from hulk/gd32e23x_template_cmake_vscode
for debug
This commit is contained in:
15
Src/main.c
15
Src/main.c
@@ -38,6 +38,8 @@ OF SUCH DAMAGE.
|
||||
#include "led.h"
|
||||
#include "command.h"
|
||||
#include <stdio.h>
|
||||
#include "i2c.h"
|
||||
#include "board_config.h"
|
||||
|
||||
bool g_status_switch = false;
|
||||
|
||||
@@ -56,6 +58,7 @@ int main(void)
|
||||
|
||||
led_init();
|
||||
|
||||
#ifdef DEBUG_VERBOSE
|
||||
char hello_world[] = {"Hello World!"};
|
||||
|
||||
for (uint8_t i = 0; i < sizeof(hello_world); i++)
|
||||
@@ -65,6 +68,18 @@ int main(void)
|
||||
}
|
||||
|
||||
while (usart_flag_get(RS485_PHY, USART_FLAG_TC) == RESET) {}
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
i2c_config();
|
||||
|
||||
// i2c_bus_reset();
|
||||
|
||||
#ifdef DEBUG_VERBOSE
|
||||
i2c_scan();
|
||||
#endif
|
||||
|
||||
|
||||
while(1){
|
||||
command_process();
|
||||
|
@@ -11,7 +11,7 @@
|
||||
\retval none
|
||||
*/
|
||||
void soft_i2c_delay(void) {
|
||||
delay_us(20); // Adjust delay as needed
|
||||
delay_10us(2); // Adjust delay as needed
|
||||
/* delay to freq
|
||||
* 15KHz: delay_us(20);
|
||||
* 65KHz: delay_us(1);
|
||||
|
Reference in New Issue
Block a user