Skip to content

Commit 8c6eb9c

Browse files
committed
[stm32f429-discovery] General sweep to fix style according to make stylecheck.
1 parent c06aba1 commit 8c6eb9c

File tree

26 files changed

+1111
-983
lines changed

26 files changed

+1111
-983
lines changed

examples/stm32/f4/stm32f429i-discovery/lcd-serial/clock.c

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,18 +33,21 @@
3333
static volatile uint32_t system_millis;
3434

3535
/* Called when systick fires */
36-
void sys_tick_handler(void) {
36+
void sys_tick_handler(void)
37+
{
3738
system_millis++;
3839
}
3940

4041
/* simple sleep for delay milliseconds */
41-
void msleep(uint32_t delay) {
42+
void msleep(uint32_t delay)
43+
{
4244
uint32_t wake = system_millis + delay;
43-
while (wake > system_millis) ;
45+
while (wake > system_millis);
4446
}
4547

4648
/* Getter function for the current time */
47-
uint32_t mtime(void) {
49+
uint32_t mtime(void)
50+
{
4851
return system_millis;
4952
}
5053

examples/stm32/f4/stm32f429i-discovery/lcd-serial/console.c

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,10 @@
4141
* read by the program. See the README file for a discussion of
4242
* the failure semantics.
4343
*/
44-
#define RECV_BUF_SIZE 128 // Arbitrary buffer size
44+
#define RECV_BUF_SIZE 128 /* Arbitrary buffer size */
4545
char recv_buf[RECV_BUF_SIZE];
46-
volatile int recv_ndx_nxt; // Next place to store
47-
volatile int recv_ndx_cur; // Next place to read
46+
volatile int recv_ndx_nxt; /* Next place to store */
47+
volatile int recv_ndx_cur; /* Next place to read */
4848

4949
/* For interrupt handling we add a new function which is called
5050
* when recieve interrupts happen. The name (usart1_isr) is created
@@ -57,7 +57,8 @@ volatile int recv_ndx_cur; // Next place to read
5757
* right or it won't work. And you'll wonder where your interrupts
5858
* are going.
5959
*/
60-
void usart1_isr(void) {
60+
void usart1_isr(void)
61+
{
6162
uint32_t reg;
6263
int i;
6364

@@ -79,7 +80,8 @@ void usart1_isr(void) {
7980
recv_ndx_nxt = i;
8081
}
8182
}
82-
} while ((reg & USART_SR_RXNE) != 0); // can read back-to-back interrupts
83+
} while ((reg & USART_SR_RXNE) != 0); /* can read back-to-back
84+
interrupts */
8385
}
8486

8587
/*
@@ -88,7 +90,8 @@ void usart1_isr(void) {
8890
* Send the character 'c' to the USART, wait for the USART
8991
* transmit buffer to be empty first.
9092
*/
91-
void console_putc(char c) {
93+
void console_putc(char c)
94+
{
9295
uint32_t reg;
9396
do {
9497
reg = USART_SR(CONSOLE_UART);
@@ -106,10 +109,11 @@ void console_putc(char c) {
106109
* The implementation is a bit different however, now it looks
107110
* in the ring buffer to see if a character has arrived.
108111
*/
109-
char console_getc(int wait) {
112+
char console_getc(int wait)
113+
{
110114
char c = 0;
111115

112-
while ((wait != 0) && (recv_ndx_cur == recv_ndx_nxt)) ;
116+
while ((wait != 0) && (recv_ndx_cur == recv_ndx_nxt));
113117
if (recv_ndx_cur != recv_ndx_nxt) {
114118
c = recv_buf[recv_ndx_cur];
115119
recv_ndx_cur = (recv_ndx_cur + 1) % RECV_BUF_SIZE;
@@ -124,7 +128,8 @@ char console_getc(int wait) {
124128
* after the last character, as indicated by a NUL character, is
125129
* reached.
126130
*/
127-
void console_puts(char *s) {
131+
void console_puts(char *s)
132+
{
128133
while (*s != '\000') {
129134
console_putc(*s);
130135
/* Add in a carraige return, after sending line feed */
@@ -142,7 +147,8 @@ void console_puts(char *s) {
142147
* support for editing characters (back space and delete)
143148
* end when a <CR> character is received.
144149
*/
145-
int console_gets(char *s, int len) {
150+
int console_gets(char *s, int len)
151+
{
146152
char *t = s;
147153
char c;
148154

@@ -165,7 +171,7 @@ int console_gets(char *s, int len) {
165171
/* update end of string with NUL */
166172
*t = '\000';
167173
}
168-
return (t - s);
174+
return t - s;
169175
}
170176

171177
/*
@@ -174,7 +180,8 @@ int console_gets(char *s, int len) {
174180
* Set the pins and clocks to create a console that we can
175181
* use for serial messages and getting text from the user.
176182
*/
177-
void console_setup(int baud) {
183+
void console_setup(int baud)
184+
{
178185

179186
/* MUST enable the GPIO clock in ADDITION to the USART clock */
180187
rcc_periph_clock_enable(RCC_GPIOA);

examples/stm32/f4/stm32f429i-discovery/lcd-serial/console.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
* These define sort of the minimum "library" of functions which
2828
* we can use on a serial port. If you wish to use a different
2929
* USART there are several things to change:
30-
* - CONSOLE_UART change this
30+
* - CONSOLE_UART change this
3131
* - Change the peripheral enable clock
3232
* - add usartx_isr for interrupts
3333
* - nvic_enable_interrupt(your choice of USART/UART)

examples/stm32/f4/stm32f429i-discovery/lcd-serial/font-7x12.c

Lines changed: 129 additions & 129 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)