aboutsummaryrefslogtreecommitdiff
path: root/ports/minimal/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'ports/minimal/main.c')
-rw-r--r--ports/minimal/main.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/ports/minimal/main.c b/ports/minimal/main.c
index adc1dad0c..27ba9ed9f 100644
--- a/ports/minimal/main.c
+++ b/ports/minimal/main.c
@@ -33,7 +33,7 @@ static char heap[2048];
int main(int argc, char **argv) {
int stack_dummy;
- stack_top = (char*)&stack_dummy;
+ stack_top = (char *)&stack_dummy;
#if MICROPY_ENABLE_GC
gc_init(heap, heap + sizeof(heap));
@@ -84,11 +84,15 @@ mp_obj_t mp_builtin_open(size_t n_args, const mp_obj_t *args, mp_map_t *kwargs)
MP_DEFINE_CONST_FUN_OBJ_KW(mp_builtin_open_obj, 1, mp_builtin_open);
void nlr_jump_fail(void *val) {
- while (1);
+ while (1) {
+ ;
+ }
}
void NORETURN __fatal_error(const char *msg) {
- while (1);
+ while (1) {
+ ;
+ }
}
#ifndef NDEBUG
@@ -149,7 +153,7 @@ void _start(void) {
// when we get here: stack is initialised, bss is clear, data is copied
// SCB->CCR: enable 8-byte stack alignment for IRQ handlers, in accord with EABI
- *((volatile uint32_t*)0xe000ed14) |= 1 << 9;
+ *((volatile uint32_t *)0xe000ed14) |= 1 << 9;
// initialise the cpu and peripherals
#if MICROPY_MIN_USE_STM32_MCU
@@ -205,10 +209,10 @@ typedef struct {
volatile uint32_t CR1;
} periph_uart_t;
-#define USART1 ((periph_uart_t*) 0x40011000)
-#define GPIOA ((periph_gpio_t*) 0x40020000)
-#define GPIOB ((periph_gpio_t*) 0x40020400)
-#define RCC ((periph_rcc_t*) 0x40023800)
+#define USART1 ((periph_uart_t *) 0x40011000)
+#define GPIOA ((periph_gpio_t *) 0x40020000)
+#define GPIOB ((periph_gpio_t *) 0x40020400)
+#define RCC ((periph_rcc_t *) 0x40023800)
// simple GPIO interface
#define GPIO_MODE_IN (0)