Appiko
main.c
1 /*
2  * main.c : Application to print on rtt
3  * Copyright (C) 2019 Appiko
4  *
5  * This program is free software: you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation, either version 3 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program. If not, see <https://www.gnu.org/licenses/>.
17  */
18 
29 #include <stdbool.h>
30 #include <stdint.h>
31 #include "hal_nop_delay.h"
32 #include "hal_gpio.h"
33 #include "boards.h"
34 #include "SEGGER_RTT.h"
35 
39 int main(void){
40  /* Configure a LED as output. */
41  hal_gpio_cfg_output(LED_1, 0);
42  /* Initial printf */
43  SEGGER_RTT_printf(0, "Hello World over RTT!\n");
44 
45  uint32_t count = 0;
46 
47  /* Toggle LED 1 and keep printing hello and an
48  * incremented integer */
49  while (true){
50  SEGGER_RTT_printf(0, "Hello %d\n", count);
51  hal_gpio_pin_toggle(LED_1);
52  hal_nop_delay_ms(1500);
53  count++;
54  }
55 }
56 
int main(void)
Function for application main entry.
Definition: main.c:90