Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
firmware
boards
breezy
breezystm32
main.c
Go to the documentation of this file.
1
/*
2
main.c : entry routine for for STM32F103CB
3
4
Adapted from https://github.com/multiwii/baseflight/blob/master/src/main.c
5
6
This file is part of BreezySTM32.
7
8
BreezySTM32 is free software: you can redistribute it and/or modify
9
it under the terms of the GNU General Public License as published by
10
the Free Software Foundation, either version 3 of the License, or
11
(at your option) any later version.
12
13
BreezySTM32 is distributed in the hope that it will be useful,
14
but WITHOUT ANY WARRANTY; without even the implied warranty of
15
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
GNU General Public License for more details.
17
18
You should have received a copy of the GNU General Public License
19
along with BreezySTM32. If not, see <http://www.gnu.org/licenses/>.
20
*/
21
22
#include "
breezystm32.h
"
23
24
serialPort_t
*
Serial1
;
25
26
extern
void
SetSysClock
(
bool
overclock);
27
28
static
void
_putc
(
void
*p,
char
c)
29
{
30
(void)p;
// avoid compiler warning about unused variable
31
serialWrite
(Serial1, c);
32
33
while
(!
isSerialTransmitBufferEmpty
(Serial1));
34
}
35
36
int
main
(
void
)
37
{
38
// Configure clock, this figures out HSE for hardware autodetect
39
SetSysClock
(0);
40
41
systemInit
();
42
43
Serial1 =
uartOpen
(
USART1
,
NULL
, 115200,
MODE_RXTX
);
44
45
setup
();
46
47
init_printf
(
NULL
,
_putc
);
48
49
while
(1)
50
loop
();
51
}
systemInit
void systemInit(void)
Definition:
system.c:55
SetSysClock
void SetSysClock(bool overclock)
Definition:
system_stm32f10x.c:90
MODE_RXTX
Definition:
drv_serial.h:29
setup
void setup(void)
Definition:
accelgyro.c:40
loop
void loop(void)
Definition:
accelgyro.c:50
USART1
#define USART1
Definition:
stm32f4xx.h:2080
isSerialTransmitBufferEmpty
bool isSerialTransmitBufferEmpty(serialPort_t *instance)
Definition:
drv_serial.c:60
breezystm32.h
serialPort
Definition:
drv_serial.h:33
serialWrite
void serialWrite(serialPort_t *instance, uint8_t ch)
Definition:
drv_serial.c:40
uartOpen
serialPort_t * uartOpen(USART_TypeDef *USARTx, serialReceiveCallbackPtr callback, uint32_t baudRate, portMode_t mode)
Definition:
drv_uart.c:80
init_printf
void init_printf(void *putp, void(*putf)(void *, char))
Definition:
printf.cpp:262
Serial1
serialPort_t * Serial1
Definition:
main.c:24
_putc
static void _putc(void *p, char c)
Definition:
main.c:28
NULL
#define NULL
Definition:
usbd_def.h:50
main
int main(void)
Definition:
main.c:36
rosflight_firmware
Author(s): Daniel Koch
, James Jackson
autogenerated on Wed Jul 3 2019 19:59:24