Verified Commit 4c419805 authored by Rahix's avatar Rahix
Browse files

chore(pycardium): Fix style

parent 766caee1
...@@ -4,14 +4,14 @@ ...@@ -4,14 +4,14 @@
#include "max32665.h" #include "max32665.h"
static char* stack_top; static char *stack_top;
static char heap[4096]; static char heap[4096];
int main(void) int main(void)
{ {
/* TODO: Replace this with a proper heap implementation */ /* TODO: Replace this with a proper heap implementation */
int stack_dummy; int stack_dummy;
stack_top = (char*)&stack_dummy; stack_top = (char *)&stack_dummy;
/* TMR5 is used to notify on keyboard interrupt */ /* TMR5 is used to notify on keyboard interrupt */
NVIC_EnableIRQ(TMR5_IRQn); NVIC_EnableIRQ(TMR5_IRQn);
...@@ -28,11 +28,12 @@ int main(void) ...@@ -28,11 +28,12 @@ int main(void)
void gc_collect(void) void gc_collect(void)
{ {
/* TODO: Replace this with a proper heap implementation */ /* TODO: Replace this with a proper heap implementation */
void* dummy; void *dummy;
gc_collect_start(); gc_collect_start();
gc_collect_root( gc_collect_root(
&dummy, &dummy,
((mp_uint_t)stack_top - (mp_uint_t)&dummy) / sizeof(mp_uint_t)); ((mp_uint_t)stack_top - (mp_uint_t)&dummy) / sizeof(mp_uint_t)
);
gc_collect_end(); gc_collect_end();
} }
...@@ -36,7 +36,7 @@ static MP_DEFINE_CONST_DICT(leds_module_globals, leds_module_globals_table); ...@@ -36,7 +36,7 @@ static MP_DEFINE_CONST_DICT(leds_module_globals, leds_module_globals_table);
const mp_obj_module_t leds_module = { const mp_obj_module_t leds_module = {
.base = { &mp_type_module }, .base = { &mp_type_module },
.globals = (mp_obj_dict_t*)&leds_module_globals, .globals = (mp_obj_dict_t *)&leds_module_globals,
}; };
/* Register the module to make it available in Python */ /* Register the module to make it available in Python */
......
...@@ -21,7 +21,7 @@ static MP_DEFINE_CONST_DICT(time_module_globals, time_module_globals_table); ...@@ -21,7 +21,7 @@ static MP_DEFINE_CONST_DICT(time_module_globals, time_module_globals_table);
const mp_obj_module_t mp_module_utime = { const mp_obj_module_t mp_module_utime = {
.base = { &mp_type_module }, .base = { &mp_type_module },
.globals = (mp_obj_dict_t*)&time_module_globals, .globals = (mp_obj_dict_t *)&time_module_globals,
}; };
/* Register the module to make it available in Python */ /* Register the module to make it available in Python */
......
...@@ -26,7 +26,7 @@ int mp_hal_stdin_rx_chr(void) ...@@ -26,7 +26,7 @@ int mp_hal_stdin_rx_chr(void)
} }
/* Send string of given length */ /* Send string of given length */
void mp_hal_stdout_tx_strn(const char* str, mp_uint_t len) void mp_hal_stdout_tx_strn(const char *str, mp_uint_t len)
{ {
epic_uart_write_str(str, len); epic_uart_write_str(str, len);
} }
...@@ -88,9 +88,9 @@ void mp_hal_delay_us(mp_uint_t us) ...@@ -88,9 +88,9 @@ void mp_hal_delay_us(mp_uint_t us)
* Fatal Errors * Fatal Errors
*/ */
extern NORETURN void * Reset_Handler (void); extern NORETURN void *Reset_Handler(void);
void NORETURN nlr_jump_fail(void* val) void NORETURN nlr_jump_fail(void *val)
{ {
char msg[] = " >>> nlr_jump_fail <<<\r\n"; char msg[] = " >>> nlr_jump_fail <<<\r\n";
epic_uart_write_str(msg, sizeof(msg)); epic_uart_write_str(msg, sizeof(msg));
...@@ -102,18 +102,18 @@ void NORETURN nlr_jump_fail(void* val) ...@@ -102,18 +102,18 @@ void NORETURN nlr_jump_fail(void* val)
* Stubs * Stubs
*/ */
mp_lexer_t* mp_lexer_new_from_file(const char* filename) mp_lexer_t *mp_lexer_new_from_file(const char *filename)
{ {
/* TODO: Do we need an implementation for this? */ /* TODO: Do we need an implementation for this? */
mp_raise_OSError(MP_ENOENT); mp_raise_OSError(MP_ENOENT);
} }
mp_import_stat_t mp_import_stat(const char* path) mp_import_stat_t mp_import_stat(const char *path)
{ {
return MP_IMPORT_STAT_NO_EXIST; return MP_IMPORT_STAT_NO_EXIST;
} }
mp_obj_t mp_builtin_open(size_t n_args, const mp_obj_t* args, mp_map_t* kwargs) mp_obj_t mp_builtin_open(size_t n_args, const mp_obj_t *args, mp_map_t *kwargs)
{ {
/* TODO: Once fs is implemented, get this working as well */ /* TODO: Once fs is implemented, get this working as well */
return mp_const_none; return mp_const_none;
......
#include "py/mpconfig.h" #include "py/mpconfig.h"
/* TODO: Replace this with a proper implementation */ /* TODO: Replace this with a proper implementation */
static inline mp_uint_t mp_hal_ticks_ms(void) { return 0; } static inline mp_uint_t mp_hal_ticks_ms(void)
{
return 0;
}
void mp_hal_set_interrupt_char(char c); void mp_hal_set_interrupt_char(char c);
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment