all: Reformat C and Python source code with tools/codeformat.py.
This is run with uncrustify 0.70.1, and black 19.10b0.
This commit is contained in:
@@ -30,8 +30,8 @@ void do_str(const char *src, mp_parse_input_kind_t input_kind) {
|
||||
int main(int argc, char **argv) {
|
||||
mp_stack_ctrl_init();
|
||||
mp_stack_set_limit(10240);
|
||||
uint32_t heap[16*1024 / 4];
|
||||
gc_init(heap, (char*)heap + 16 * 1024);
|
||||
uint32_t heap[16 * 1024 / 4];
|
||||
gc_init(heap, (char *)heap + 16 * 1024);
|
||||
mp_init();
|
||||
do_str("print('hello world!')", MP_PARSE_SINGLE_INPUT);
|
||||
mp_deinit();
|
||||
|
||||
@@ -43,5 +43,5 @@ STATIC MP_DEFINE_CONST_DICT(machine_module_globals, machine_module_globals_table
|
||||
|
||||
const mp_obj_module_t mp_module_machine = {
|
||||
.base = { &mp_type_module },
|
||||
.globals = (mp_obj_dict_t*)&machine_module_globals,
|
||||
.globals = (mp_obj_dict_t *)&machine_module_globals,
|
||||
};
|
||||
|
||||
@@ -49,5 +49,5 @@ STATIC MP_DEFINE_CONST_DICT(os_module_globals, os_module_globals_table);
|
||||
|
||||
const mp_obj_module_t mp_module_uos = {
|
||||
.base = { &mp_type_module },
|
||||
.globals = (mp_obj_dict_t*)&os_module_globals,
|
||||
.globals = (mp_obj_dict_t *)&os_module_globals,
|
||||
};
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
|
||||
// type definitions for the specific machine
|
||||
|
||||
#define MICROPY_MAKE_POINTER_CALLABLE(p) ((void*)((mp_uint_t)(p) | 1))
|
||||
#define MICROPY_MAKE_POINTER_CALLABLE(p) ((void *)((mp_uint_t)(p) | 1))
|
||||
|
||||
#define MP_SSIZE_MAX (0x7fffffff)
|
||||
|
||||
|
||||
@@ -68,7 +68,7 @@ __attribute__((naked)) void exit(int status) {
|
||||
".notclean:\n"
|
||||
"movs r0, #0x18\n" // SYS_EXIT
|
||||
"bkpt 0xab\n"
|
||||
);
|
||||
);
|
||||
for (;;) {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,13 +1,16 @@
|
||||
import micropython
|
||||
|
||||
|
||||
@micropython.native
|
||||
def native_x(x):
|
||||
print(x + 1)
|
||||
|
||||
|
||||
@micropython.native
|
||||
def native_y(x):
|
||||
print(x + 1)
|
||||
|
||||
|
||||
@micropython.native
|
||||
def native_z(x):
|
||||
print(x + 1)
|
||||
|
||||
@@ -23,7 +23,7 @@ int main() {
|
||||
mp_stack_ctrl_init();
|
||||
mp_stack_set_limit(10240);
|
||||
static uint32_t heap[HEAP_SIZE / sizeof(uint32_t)];
|
||||
upytest_set_heap(heap, (char*)heap + HEAP_SIZE);
|
||||
upytest_set_heap(heap, (char *)heap + HEAP_SIZE);
|
||||
int r = tinytest_main(0, NULL, groups);
|
||||
printf("status: %d\n", r);
|
||||
return r;
|
||||
@@ -37,7 +37,7 @@ void gc_collect(void) {
|
||||
uintptr_t sp = gc_helper_get_regs_and_sp(regs);
|
||||
|
||||
// trace the stack, including the registers (since they live on the stack in this function)
|
||||
gc_collect_root((void**)sp, ((uint32_t)MP_STATE_THREAD(stack_top) - (uint32_t)sp) / sizeof(uint32_t));
|
||||
gc_collect_root((void **)sp, ((uint32_t)MP_STATE_THREAD(stack_top) - (uint32_t)sp) / sizeof(uint32_t));
|
||||
|
||||
gc_collect_end();
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ typedef struct _UART_t {
|
||||
volatile uint32_t DR;
|
||||
} UART_t;
|
||||
|
||||
#define UART0 ((UART_t*)(0x40011000))
|
||||
#define UART0 ((UART_t *)(0x40011000))
|
||||
|
||||
void uart_init(void) {
|
||||
}
|
||||
@@ -32,7 +32,7 @@ typedef struct _UART_t {
|
||||
volatile uint32_t TXD; // 0x51c
|
||||
} UART_t;
|
||||
|
||||
#define UART0 ((UART_t*)(0x40002000))
|
||||
#define UART0 ((UART_t *)(0x40002000))
|
||||
|
||||
void uart_init(void) {
|
||||
UART0->ENABLE = 4;
|
||||
@@ -60,7 +60,7 @@ typedef struct _UART_t {
|
||||
volatile uint32_t BAUDDIV;
|
||||
} UART_t;
|
||||
|
||||
#define UART0 ((UART_t*)(0x40004000))
|
||||
#define UART0 ((UART_t *)(0x40004000))
|
||||
|
||||
void uart_init(void) {
|
||||
UART0->BAUDDIV = 16;
|
||||
|
||||
Reference in New Issue
Block a user