fix i2c reset bus function

This commit is contained in:
2025-08-14 23:59:15 +08:00
parent 88f79f7eb0
commit 90486c6609
3 changed files with 112 additions and 42 deletions

View File

@@ -60,7 +60,7 @@ int main(void)
led_init();
#ifdef DEBUG_VERBOSE
char hello_world[] = {"Hello World!"};
char hello_world[] = {"Hello World!\r\n"};
for (uint8_t i = 0; i < sizeof(hello_world); i++)
{
@@ -69,29 +69,23 @@ int main(void)
}
while (usart_flag_get(RS485_PHY, USART_FLAG_TC) == RESET) {}
#endif
#endif
#ifdef DEBUG_VERBOSE
i2c_config();
i2c_scan();
// i2c_bus_reset();
// uint8_t sensor_data[2] = {0};
// i2c_read_16bits(0x2B, 0x7E, sensor_data);
// printf("Sensor Data: 0x%02X 0x%02X\r\n", sensor_data[0], sensor_data[1]);
// i2c_bus_reset();
i2c_bus_reset();
i2c_scan();
#endif
ldc1612_iic_get_sensor_infomation();
#ifdef DEBUG_VERBOSE
i2c_scan();
#endif
while(1){
command_process();