comparison target-utils/helloapp/main.c @ 992:a7b0b426f9ca

target-utils: boot ROM UART autodetection revamped The new implementation should work with both the familiar Calypso C035 boot ROM version found in our regular targets as well as the older Calypso F741979B version found on the vintage D-Sample board.
author Mychaela Falconia <falcon@ivan.Harhan.ORG>
date Wed, 30 Dec 2015 21:28:41 +0000
parents be293e656a6f
children
comparison
equal deleted inserted replaced
991:5cff3579814c 992:a7b0b426f9ca
1 #include "types.h"
2 #include "romvars.h"
3
4 extern struct boot_rom_vars rom_vars;
5
6 extern char *uart_name;
7
8 main() 1 main()
9 { 2 {
10 uart_select_init(); 3 uart_select_init();
11 printf("Hello-world demo app running\n"); 4 printf("Hello-world demo app running\n");
12 printf("Loaded via UART %d (%s) at baud rate #%d\n", rom_vars.uart_id, 5 print_boot_rom_info();
13 uart_name, rom_vars.baud_rate_code);
14 printf("TCXO clock input autodetected to be %d MHz\n",
15 rom_vars.clktcxo_13mhz ? 13 : 26);
16 for (;;) { 6 for (;;) {
17 putchar('='); 7 putchar('=');
18 if (command_entry()) 8 if (command_entry())
19 command_dispatch(); 9 command_dispatch();
20 } 10 }