Skip to content
Snippets Groups Projects
Verified Commit 4c419805 authored by rahix's avatar rahix
Browse files

chore(pycardium): Fix style

parent 766caee1
No related branches found
No related tags found
No related merge requests found
......@@ -4,14 +4,14 @@
#include "max32665.h"
static char* stack_top;
static char *stack_top;
static char heap[4096];
int main(void)
{
/* TODO: Replace this with a proper heap implementation */
int stack_dummy;
stack_top = (char*)&stack_dummy;
stack_top = (char *)&stack_dummy;
/* TMR5 is used to notify on keyboard interrupt */
NVIC_EnableIRQ(TMR5_IRQn);
......@@ -28,11 +28,12 @@ int main(void)
void gc_collect(void)
{
/* TODO: Replace this with a proper heap implementation */
void* dummy;
void *dummy;
gc_collect_start();
gc_collect_root(
&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();
}
......@@ -36,7 +36,7 @@ static MP_DEFINE_CONST_DICT(leds_module_globals, leds_module_globals_table);
const mp_obj_module_t leds_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 */
......
......@@ -21,7 +21,7 @@ static MP_DEFINE_CONST_DICT(time_module_globals, time_module_globals_table);
const mp_obj_module_t mp_module_utime = {
.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 */
......
......@@ -26,7 +26,7 @@ int mp_hal_stdin_rx_chr(void)
}
/* 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);
}
......@@ -88,9 +88,9 @@ void mp_hal_delay_us(mp_uint_t us)
* 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";
epic_uart_write_str(msg, sizeof(msg));
......@@ -102,18 +102,18 @@ void NORETURN nlr_jump_fail(void* val)
* 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? */
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;
}
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 */
return mp_const_none;
......
#include "py/mpconfig.h"
/* 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);
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment