Commit 5874c1c9 authored by Damien George's avatar Damien George
Browse files

stmhal: Remove #include <stdint.h> from mpconfigport.h.

Make include dependencies neater, and adheres to the coding convention
that headers should not include headers.
parent e88814a2
......@@ -4,7 +4,7 @@
#include "obj.h"
#include "bufhelper.h"
void pyb_buf_get_for_send(mp_obj_t o, mp_buffer_info_t *bufinfo, uint8_t *tmp_data) {
void pyb_buf_get_for_send(mp_obj_t o, mp_buffer_info_t *bufinfo, byte *tmp_data) {
if (MP_OBJ_IS_INT(o)) {
tmp_data[0] = mp_obj_get_int(o);
bufinfo->buf = tmp_data;
......
void pyb_buf_get_for_send(mp_obj_t o, mp_buffer_info_t *bufinfo, uint8_t *tmp_data);
void pyb_buf_get_for_send(mp_obj_t o, mp_buffer_info_t *bufinfo, byte *tmp_data);
mp_obj_t pyb_buf_get_for_recv(mp_obj_t o, mp_buffer_info_t *bufinfo);
......@@ -41,9 +41,9 @@ void gc_collect(void) {
gc_info_t info;
gc_info(&info);
printf("GC@%lu %lums\n", start, ticks);
printf(" %lu total\n", info.total);
printf(" %lu : %lu\n", info.used, info.free);
printf(" 1=%lu 2=%lu m=%lu\n", info.num_1block, info.num_2block, info.max_block);
printf(" " UINT_FMT " total\n", info.total);
printf(" " UINT_FMT " : " UINT_FMT "\n", info.used, info.free);
printf(" 1=" UINT_FMT " 2=" UINT_FMT " m=" UINT_FMT "\n", info.num_1block, info.num_2block, info.max_block);
}
}
......
#include <stdint.h>
#include "mpconfig.h"
#include "nlr.h"
#include "misc.h"
......
#include <stdint.h>
#include <string.h>
#include "mpconfig.h"
......
......@@ -82,9 +82,9 @@ STATIC mp_obj_t pyb_info(uint n_args, const mp_obj_t *args) {
gc_info_t info;
gc_info(&info);
printf("GC:\n");
printf(" %lu total\n", info.total);
printf(" %lu : %lu\n", info.used, info.free);
printf(" 1=%lu 2=%lu m=%lu\n", info.num_1block, info.num_2block, info.max_block);
printf(" " UINT_FMT " total\n", info.total);
printf(" " UINT_FMT " : " UINT_FMT "\n", info.used, info.free);
printf(" 1=" UINT_FMT " 2=" UINT_FMT " m=" UINT_FMT "\n", info.num_1block, info.num_2block, info.max_block);
}
// free space on flash
......
#include <stdint.h>
// options to control how Micro Python is built
#define MICROPY_EMIT_THUMB (1)
......@@ -51,11 +49,11 @@ extern const struct _mp_obj_module_t time_module;
#define BYTES_PER_WORD (4)
#define UINT_FMT "%lu"
#define INT_FMT "%ld"
#define UINT_FMT "%u"
#define INT_FMT "%d"
typedef int32_t machine_int_t; // must be pointer size
typedef uint32_t machine_uint_t; // must be pointer size
typedef int machine_int_t; // must be pointer size
typedef unsigned int machine_uint_t; // must be pointer size
typedef void *machine_ptr_t; // must be of pointer size
typedef const void *machine_const_ptr_t; // must be of pointer size
......
......@@ -84,9 +84,9 @@ bool parse_compile_execute(mp_lexer_t *lex, mp_parse_input_kind_t input_kind, bo
gc_info_t info;
gc_info(&info);
printf("GC:\n");
printf(" %lu total\n", info.total);
printf(" %lu : %lu\n", info.used, info.free);
printf(" 1=%lu 2=%lu m=%lu\n", info.num_1block, info.num_2block, info.max_block);
printf(" " UINT_FMT " total\n", info.total);
printf(" " UINT_FMT " : " UINT_FMT "\n", info.used, info.free);
printf(" 1=" UINT_FMT " 2=" UINT_FMT " m=" UINT_FMT "\n", info.num_1block, info.num_2block, info.max_block);
}
}
......
......@@ -467,7 +467,7 @@ void timer_irq_handler(uint tim_id) {
// Uncaught exception; disable the callback so it doesn't run again.
tim->callback = mp_const_none;
__HAL_TIM_DISABLE_IT(&tim->tim, TIM_IT_UPDATE);
printf("Uncaught exception in Timer(%lu) interrupt handler\n", tim->tim_id);
printf("Uncaught exception in Timer(" UINT_FMT ") interrupt handler\n", tim->tim_id);
mp_obj_print_exception((mp_obj_t)nlr.ret_val);
}
gc_unlock();
......
Markdown is supported
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