add mcu flash detect

This commit is contained in:
2025-08-25 21:10:54 +08:00
parent 6d9328ca23
commit cad99ca5f2
9 changed files with 145 additions and 35 deletions

View File

@@ -49,23 +49,17 @@ OF SUCH DAMAGE.
*/
int main(void)
{
led_init();
mcu_detect_and_config();
setbuf(stdout, NULL);
systick_config();
rs485_init();
led_init();
printf("Flash size: %d Kbytes\n", get_flash_size());
#ifdef DEBUG_VERBOSE
char hello_world[] = {"Hello World!\r\n"};
for (uint8_t i = 0; i < sizeof(hello_world); i++)
{
while (usart_flag_get(RS485_PHY, USART_FLAG_TBE) == RESET) {}
usart_data_transmit(RS485_PHY, hello_world[i]);
}
while (usart_flag_get(RS485_PHY, USART_FLAG_TC) == RESET) {}
printf("Hello World!\r\n");
#endif
i2c_config();
@@ -78,6 +72,6 @@ int main(void)
while(1){
command_process();
delay_ms(10);
delay_ms(10);
}
}