application: minor, replace printf with puts when applicable
This commit is contained in:
parent
55d4a2fdb5
commit
44c75a70a2
|
@ -199,34 +199,34 @@ static void command_version(void* argument)
|
||||||
// 0x414: high-density, 256-512 kB flash
|
// 0x414: high-density, 256-512 kB flash
|
||||||
// 0x430: XL-density, 768-1024 kB flash
|
// 0x430: XL-density, 768-1024 kB flash
|
||||||
// 0x418: connectivity
|
// 0x418: connectivity
|
||||||
printf("device family: ");
|
puts("device family: ");
|
||||||
switch (DBGMCU_IDCODE & DBGMCU_IDCODE_DEV_ID_MASK) {
|
switch (DBGMCU_IDCODE & DBGMCU_IDCODE_DEV_ID_MASK) {
|
||||||
case 0: // this is a known issue document in STM32F10xxC/D/E Errata sheet, without workaround
|
case 0: // this is a known issue document in STM32F10xxC/D/E Errata sheet, without workaround
|
||||||
printf("unreadable\n");
|
puts("unreadable\n");
|
||||||
break;
|
break;
|
||||||
case 0x412:
|
case 0x412:
|
||||||
printf("low-density\n");
|
puts("low-density\n");
|
||||||
break;
|
break;
|
||||||
case 0x410:
|
case 0x410:
|
||||||
printf("medium-density\n");
|
puts("medium-density\n");
|
||||||
break;
|
break;
|
||||||
case 0x414:
|
case 0x414:
|
||||||
printf("high-density\n");
|
puts("high-density\n");
|
||||||
break;
|
break;
|
||||||
case 0x430:
|
case 0x430:
|
||||||
printf("XL-density\n");
|
puts("XL-density\n");
|
||||||
break;
|
break;
|
||||||
case 0x418:
|
case 0x418:
|
||||||
printf("connectivity\n");
|
puts("connectivity\n");
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
printf("unknown\n");
|
puts("unknown\n");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// show flash size
|
// show flash size
|
||||||
printf("flash size: ");
|
puts("flash size: ");
|
||||||
if (0xffff == DESIG_FLASH_SIZE) {
|
if (0xffff == DESIG_FLASH_SIZE) {
|
||||||
printf("unknown (probably a defective micro-controller\n");
|
puts("unknown (probably a defective micro-controller\n");
|
||||||
} else {
|
} else {
|
||||||
printf("%u KB\n", DESIG_FLASH_SIZE);
|
printf("%u KB\n", DESIG_FLASH_SIZE);
|
||||||
}
|
}
|
||||||
|
@ -373,16 +373,16 @@ void main(void)
|
||||||
// show watchdog information
|
// show watchdog information
|
||||||
printf("setup watchdog: %.2fs", WATCHDOG_PERIOD / 1000.0);
|
printf("setup watchdog: %.2fs", WATCHDOG_PERIOD / 1000.0);
|
||||||
if (FLASH_OBR & FLASH_OBR_OPTERR) {
|
if (FLASH_OBR & FLASH_OBR_OPTERR) {
|
||||||
printf(" (option bytes not set in flash: software wachtdog used, not automatically started at reset)\n");
|
puts(" (option bytes not set in flash: software wachtdog used, not automatically started at reset)\n");
|
||||||
} else if (FLASH_OBR & FLASH_OBR_WDG_SW) {
|
} else if (FLASH_OBR & FLASH_OBR_WDG_SW) {
|
||||||
printf(" (software watchdog used, not automatically started at reset)\n");
|
puts(" (software watchdog used, not automatically started at reset)\n");
|
||||||
} else {
|
} else {
|
||||||
printf(" (hardware watchdog used, automatically started at reset)\n");
|
puts(" (hardware watchdog used, automatically started at reset)\n");
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// setup RTC
|
// setup RTC
|
||||||
printf("setup internal RTC: ");
|
puts("setup internal RTC: ");
|
||||||
#if defined(BLUE_PILL) || defined(STLINKV2) || defined(BLASTER) // for boards without a Low Speed External oscillator
|
#if defined(BLUE_PILL) || defined(STLINKV2) || defined(BLASTER) // for boards without a Low Speed External oscillator
|
||||||
// note: the blue pill LSE oscillator is affected when toggling the onboard LED, thus prefer the HSE
|
// note: the blue pill LSE oscillator is affected when toggling the onboard LED, thus prefer the HSE
|
||||||
rtc_auto_awake(RCC_HSE, 8000000 / 128 / RTC_TICKS_SECOND - 1); // use High Speed External oscillator (8 MHz / 128) as RTC clock (VBAT can't be used to keep the RTC running)
|
rtc_auto_awake(RCC_HSE, 8000000 / 128 / RTC_TICKS_SECOND - 1); // use High Speed External oscillator (8 MHz / 128) as RTC clock (VBAT can't be used to keep the RTC running)
|
||||||
|
@ -392,7 +392,7 @@ void main(void)
|
||||||
rtc_interrupt_enable(RTC_SEC); // enable RTC interrupt on "seconds"
|
rtc_interrupt_enable(RTC_SEC); // enable RTC interrupt on "seconds"
|
||||||
nvic_enable_irq(NVIC_RTC_IRQ); // allow the RTC to interrupt
|
nvic_enable_irq(NVIC_RTC_IRQ); // allow the RTC to interrupt
|
||||||
time_start = rtc_get_counter_val(); // get start time from internal RTC
|
time_start = rtc_get_counter_val(); // get start time from internal RTC
|
||||||
printf("OK\n");
|
puts("OK\n");
|
||||||
|
|
||||||
// setup terminal
|
// setup terminal
|
||||||
terminal_prefix = ""; // set default prefix
|
terminal_prefix = ""; // set default prefix
|
||||||
|
@ -412,7 +412,7 @@ void main(void)
|
||||||
}
|
}
|
||||||
if (button_flag) { // user pressed button
|
if (button_flag) { // user pressed button
|
||||||
action = true; // action has been performed
|
action = true; // action has been performed
|
||||||
printf("button pressed\n");
|
puts("button pressed\n");
|
||||||
led_toggle(); // toggle LED
|
led_toggle(); // toggle LED
|
||||||
for (uint32_t i = 0; i < 1000000; i++) { // wait a bit to remove noise and double trigger
|
for (uint32_t i = 0; i < 1000000; i++) { // wait a bit to remove noise and double trigger
|
||||||
__asm__("nop");
|
__asm__("nop");
|
||||||
|
|
Loading…
Reference in New Issue