File tree 3 files changed +15
-6
lines changed
3 files changed +15
-6
lines changed Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ QSTR_DEFS = qstrdefsport.h
7
7
include $(TOP ) /py/py.mk
8
8
include $(TOP ) /extmod/extmod.mk
9
9
10
- XCVERSION ?= 1.35
10
+ XCVERSION ?= 2.10
11
11
XC16 ?= /opt/microchip/xc16/v$(XCVERSION )
12
12
CROSS_COMPILE ?= $(XC16 ) /bin/xc16-
13
13
@@ -31,7 +31,7 @@ CFLAGS += -O1 -DNDEBUG
31
31
endif
32
32
33
33
LDFLAGS += --heap=0 -nostdlib -T $(XC16 ) /support/$(PARTFAMILY ) /gld/p$(PART ) .gld -Map=$@ .map --cref -p$(PART )
34
- LIBS += -L$(XC16 ) /lib -L$(XC16 ) /lib/$(PARTFAMILY ) -lc -lm -lpic30
34
+ LIBS += -L$(XC16 ) /lib -L$(XC16 ) /lib/$(PARTFAMILY ) -lc99-elf -lm-elf -lc99-pic30-elf
35
35
36
36
SRC_C = \
37
37
main.c \
Original file line number Diff line number Diff line change @@ -93,7 +93,3 @@ typedef int mp_off_t;
93
93
#define MICROPY_MPHALPORT_H "pic16bit_mphal.h"
94
94
#define MICROPY_HW_BOARD_NAME "dsPICSK"
95
95
#define MICROPY_HW_MCU_NAME "dsPIC33"
96
-
97
- // XC16 toolchain doesn't seem to define these
98
- typedef int intptr_t ;
99
- typedef unsigned int uintptr_t ;
Original file line number Diff line number Diff line change @@ -380,6 +380,18 @@ static inline bool mp_check(bool value) {
380
380
381
381
// mp_int_t can be larger than long, i.e. Windows 64-bit, nan-box variants
382
382
static inline uint32_t mp_clz_mpi (mp_int_t x ) {
383
+ #ifdef __XC16__
384
+ mp_uint_t mask = MP_OBJ_WORD_MSBIT_HIGH ;
385
+ mp_uint_t zeroes = 0 ;
386
+ while (mask != 0 ) {
387
+ if (mask & (mp_uint_t )x ) {
388
+ break ;
389
+ }
390
+ zeroes ++ ;
391
+ mask >>= 1 ;
392
+ }
393
+ return zeroes ;
394
+ #else
383
395
MP_STATIC_ASSERT (sizeof (mp_int_t ) == sizeof (long long )
384
396
|| sizeof (mp_int_t ) == sizeof (long ));
385
397
@@ -389,6 +401,7 @@ static inline uint32_t mp_clz_mpi(mp_int_t x) {
389
401
} else {
390
402
return mp_clzll ((unsigned long long )x );
391
403
}
404
+ #endif
392
405
}
393
406
394
407
#endif // MICROPY_INCLUDED_PY_MISC_H
You can’t perform that action at this time.
0 commit comments