Skip to content

Commit e7bee6b

Browse files
committed
pic16bit: Minor updates to types to allow port to compile again.
1 parent 31dd312 commit e7bee6b

4 files changed

Lines changed: 9 additions & 3 deletions

File tree

pic16bit/modpybled.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ void pyb_led_print(const mp_print_t *print, mp_obj_t self_in, mp_print_kind_t ki
4646
mp_printf(print, "LED(%u)", LED_ID(self));
4747
}
4848

49-
STATIC mp_obj_t pyb_led_make_new(mp_obj_t type_in, mp_uint_t n_args, mp_uint_t n_kw, const mp_obj_t *args) {
49+
STATIC mp_obj_t pyb_led_make_new(const mp_obj_type_t *type, size_t n_args, size_t n_kw, const mp_obj_t *args) {
5050
mp_arg_check_num(n_args, n_kw, 1, 1, false);
5151
mp_int_t led_id = mp_obj_get_int(args[0]);
5252
if (!(1 <= led_id && led_id <= NUM_LED)) {

pic16bit/modpybswitch.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ void pyb_switch_print(const mp_print_t *print, mp_obj_t self_in, mp_print_kind_t
4545
mp_printf(print, "Switch(%u)", SWITCH_ID(self));
4646
}
4747

48-
STATIC mp_obj_t pyb_switch_make_new(mp_obj_t type_in, mp_uint_t n_args, mp_uint_t n_kw, const mp_obj_t *args) {
48+
STATIC mp_obj_t pyb_switch_make_new(const mp_obj_type_t *type, size_t n_args, size_t n_kw, const mp_obj_t *args) {
4949
mp_arg_check_num(n_args, n_kw, 1, 1, false);
5050
mp_int_t sw_id = mp_obj_get_int(args[0]);
5151
if (!(1 <= sw_id && sw_id <= NUM_SWITCH)) {
@@ -60,7 +60,7 @@ mp_obj_t pyb_switch_value(mp_obj_t self_in) {
6060
}
6161
STATIC MP_DEFINE_CONST_FUN_OBJ_1(pyb_switch_value_obj, pyb_switch_value);
6262

63-
mp_obj_t pyb_switch_call(mp_obj_t self_in, mp_uint_t n_args, mp_uint_t n_kw, const mp_obj_t *args) {
63+
mp_obj_t pyb_switch_call(mp_obj_t self_in, size_t n_args, size_t n_kw, const mp_obj_t *args) {
6464
mp_arg_check_num(n_args, n_kw, 0, 0, false);
6565
return pyb_switch_value(self_in);
6666
}

pic16bit/mpconfigport.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,3 +108,7 @@ extern const struct _mp_obj_module_t pyb_module;
108108
#define MICROPY_MPHALPORT_H "pic16bit_mphal.h"
109109
#define MICROPY_HW_BOARD_NAME "dsPICSK"
110110
#define MICROPY_HW_MCU_NAME "dsPIC33"
111+
112+
// XC16 toolchain doesn't seem to define these
113+
typedef int intptr_t;
114+
typedef unsigned int uintptr_t;

pic16bit/unistd.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
// XC16 compiler doesn't seem to have unistd.h file
22

33
#define SEEK_CUR 1
4+
5+
typedef int ssize_t;

0 commit comments

Comments
 (0)