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

Make include dependencies neater, and adheres to the coding convention
that headers should not include headers.
This commit is contained in:
Damien George 2014-05-03 13:24:21 +01:00
parent e88814a274
commit 5874c1c92b
9 changed files with 19 additions and 18 deletions

View File

@ -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;

View File

@ -1,2 +1,2 @@
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);

View File

@ -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);
}
}

View File

@ -1,3 +1,5 @@
#include <stdint.h>
#include "mpconfig.h"
#include "nlr.h"
#include "misc.h"

View File

@ -1,3 +1,4 @@
#include <stdint.h>
#include <string.h>
#include "mpconfig.h"

View File

@ -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

View File

@ -1,5 +1,3 @@
#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

View File

@ -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);
}
}

View File

@ -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();