Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
fleur
firmware
Commits
4c419805
Verified
Commit
4c419805
authored
Jul 06, 2019
by
Rahix
Browse files
chore(pycardium): Fix style
parent
766caee1
Changes
5
Hide whitespace changes
Inline
Side-by-side
pycardium/main.c
View file @
4c419805
...
...
@@ -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
();
}
pycardium/modules/leds.c
View file @
4c419805
...
...
@@ -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 */
...
...
pycardium/modules/utime.c
View file @
4c419805
...
...
@@ -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 */
...
...
pycardium/mphalport.c
View file @
4c419805
...
...
@@ -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
;
...
...
pycardium/mphalport.h
View file @
4c419805
#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
);
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment