kopia lustrzana https://github.com/micropython/micropython
Porównaj commity
6 Commity
f2950a4f1a
...
b89366303d
Autor | SHA1 | Data |
---|---|---|
charkster | b89366303d | |
stijn | 40f7e9ce20 | |
Michiel W. Beijen | 3129b69e0f | |
Simon Wood | 19844b4983 | |
J. Neuschäfer | f76cf29402 | |
charkster | 8501ffd468 |
|
@ -88,10 +88,11 @@ jobs:
|
||||||
(cd ports/unix && gcov -o build-coverage/py ../../py/*.c || true)
|
(cd ports/unix && gcov -o build-coverage/py ../../py/*.c || true)
|
||||||
(cd ports/unix && gcov -o build-coverage/extmod ../../extmod/*.c || true)
|
(cd ports/unix && gcov -o build-coverage/extmod ../../extmod/*.c || true)
|
||||||
- name: Upload coverage to Codecov
|
- name: Upload coverage to Codecov
|
||||||
uses: codecov/codecov-action@v3
|
uses: codecov/codecov-action@v4
|
||||||
with:
|
with:
|
||||||
fail_ci_if_error: true
|
fail_ci_if_error: true
|
||||||
verbose: true
|
verbose: true
|
||||||
|
token: ${{ secrets.CODECOV_TOKEN }}
|
||||||
- name: Print failures
|
- name: Print failures
|
||||||
if: failure()
|
if: failure()
|
||||||
run: tests/run-tests.py --print-failures
|
run: tests/run-tests.py --print-failures
|
||||||
|
|
|
@ -37,7 +37,7 @@ You can also build the standard CMake way. The final firmware is found in
|
||||||
the top-level of the CMake build directory (`build` by default) and is
|
the top-level of the CMake build directory (`build` by default) and is
|
||||||
called `firmware.uf2`.
|
called `firmware.uf2`.
|
||||||
|
|
||||||
If you are using a different board other than a Rasoberry Pi Pico, then you should
|
If you are using a board other than a Raspberry Pi Pico, you should
|
||||||
pass the board name to the build; e.g. for Raspberry Pi Pico W:
|
pass the board name to the build; e.g. for Raspberry Pi Pico W:
|
||||||
|
|
||||||
$ make BOARD=RPI_PICO_W submodules
|
$ make BOARD=RPI_PICO_W submodules
|
||||||
|
|
|
@ -127,10 +127,10 @@ static void mp_machine_lightsleep(size_t n_args, const mp_obj_t *args) {
|
||||||
|
|
||||||
const uint32_t xosc_hz = XOSC_MHZ * 1000000;
|
const uint32_t xosc_hz = XOSC_MHZ * 1000000;
|
||||||
|
|
||||||
uint32_t my_interrupts = save_and_disable_interrupts();
|
uint32_t my_interrupts = mp_thread_begin_atomic_section();
|
||||||
#if MICROPY_PY_NETWORK_CYW43
|
#if MICROPY_PY_NETWORK_CYW43
|
||||||
if (cyw43_has_pending && cyw43_poll != NULL) {
|
if (cyw43_has_pending && cyw43_poll != NULL) {
|
||||||
restore_interrupts(my_interrupts);
|
mp_thread_end_atomic_section(my_interrupts);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -165,8 +165,15 @@ static void mp_machine_lightsleep(size_t n_args, const mp_obj_t *args) {
|
||||||
} else {
|
} else {
|
||||||
uint32_t sleep_en0 = clocks_hw->sleep_en0;
|
uint32_t sleep_en0 = clocks_hw->sleep_en0;
|
||||||
uint32_t sleep_en1 = clocks_hw->sleep_en1;
|
uint32_t sleep_en1 = clocks_hw->sleep_en1;
|
||||||
|
bool timer3_enabled = irq_is_enabled(3);
|
||||||
|
|
||||||
clocks_hw->sleep_en0 = CLOCKS_SLEEP_EN0_CLK_RTC_RTC_BITS;
|
clocks_hw->sleep_en0 = CLOCKS_SLEEP_EN0_CLK_RTC_RTC_BITS;
|
||||||
if (use_timer_alarm) {
|
if (use_timer_alarm) {
|
||||||
|
// Make sure ALARM3/IRQ3 is enabled on _this_ core
|
||||||
|
timer_hw->inte |= 1 << 3;
|
||||||
|
if (!timer3_enabled) {
|
||||||
|
irq_set_enabled(3, true);
|
||||||
|
}
|
||||||
// Use timer alarm to wake.
|
// Use timer alarm to wake.
|
||||||
clocks_hw->sleep_en1 = CLOCKS_SLEEP_EN1_CLK_SYS_TIMER_BITS;
|
clocks_hw->sleep_en1 = CLOCKS_SLEEP_EN1_CLK_SYS_TIMER_BITS;
|
||||||
timer_hw->alarm[3] = timer_hw->timerawl + delay_ms * 1000;
|
timer_hw->alarm[3] = timer_hw->timerawl + delay_ms * 1000;
|
||||||
|
@ -177,6 +184,9 @@ static void mp_machine_lightsleep(size_t n_args, const mp_obj_t *args) {
|
||||||
scb_hw->scr |= M0PLUS_SCR_SLEEPDEEP_BITS;
|
scb_hw->scr |= M0PLUS_SCR_SLEEPDEEP_BITS;
|
||||||
__wfi();
|
__wfi();
|
||||||
scb_hw->scr &= ~M0PLUS_SCR_SLEEPDEEP_BITS;
|
scb_hw->scr &= ~M0PLUS_SCR_SLEEPDEEP_BITS;
|
||||||
|
if (!timer3_enabled) {
|
||||||
|
irq_set_enabled(3, false);
|
||||||
|
}
|
||||||
clocks_hw->sleep_en0 = sleep_en0;
|
clocks_hw->sleep_en0 = sleep_en0;
|
||||||
clocks_hw->sleep_en1 = sleep_en1;
|
clocks_hw->sleep_en1 = sleep_en1;
|
||||||
}
|
}
|
||||||
|
@ -186,7 +196,7 @@ static void mp_machine_lightsleep(size_t n_args, const mp_obj_t *args) {
|
||||||
|
|
||||||
// Bring back all clocks.
|
// Bring back all clocks.
|
||||||
clocks_init();
|
clocks_init();
|
||||||
restore_interrupts(my_interrupts);
|
mp_thread_end_atomic_section(my_interrupts);
|
||||||
}
|
}
|
||||||
|
|
||||||
NORETURN static void mp_machine_deepsleep(size_t n_args, const mp_obj_t *args) {
|
NORETURN static void mp_machine_deepsleep(size_t n_args, const mp_obj_t *args) {
|
||||||
|
|
|
@ -0,0 +1,17 @@
|
||||||
|
{
|
||||||
|
"deploy": [
|
||||||
|
"../deploy.md"
|
||||||
|
],
|
||||||
|
"docs": "",
|
||||||
|
"features": [
|
||||||
|
"USB-C"
|
||||||
|
],
|
||||||
|
"images": [
|
||||||
|
"qt_py_samd21.jpg"
|
||||||
|
],
|
||||||
|
"mcu": "samd21",
|
||||||
|
"product": "QT PY (SAMD21)",
|
||||||
|
"thumbnail": "",
|
||||||
|
"url": "https://www.adafruit.com/product/4600",
|
||||||
|
"vendor": "Adafruit"
|
||||||
|
}
|
|
@ -0,0 +1,4 @@
|
||||||
|
#define MICROPY_HW_BOARD_NAME "QT PY"
|
||||||
|
#define MICROPY_HW_MCU_NAME "SAMD21E18A"
|
||||||
|
|
||||||
|
#define MICROPY_HW_DFLL_USB_SYNC (1)
|
|
@ -0,0 +1,4 @@
|
||||||
|
MCU_SERIES = SAMD21
|
||||||
|
CMSIS_MCU = SAMD21E18A
|
||||||
|
LD_FILES = boards/samd21x18a.ld sections.ld
|
||||||
|
TEXT0 = 0x2000
|
|
@ -0,0 +1,20 @@
|
||||||
|
A0,PA02
|
||||||
|
A1,PA03
|
||||||
|
A2,PA04
|
||||||
|
A3,PA05
|
||||||
|
SDA,PA16
|
||||||
|
SCL,PA17
|
||||||
|
TX,PA06
|
||||||
|
RX,PA07
|
||||||
|
SCK,PA11
|
||||||
|
MISO,PA09
|
||||||
|
MOSI,PA10
|
||||||
|
|
||||||
|
NEO_PWR,PA15
|
||||||
|
NEOPIX,PA18
|
||||||
|
|
||||||
|
USB_DM,PA24
|
||||||
|
USB_DP,PA25
|
||||||
|
|
||||||
|
SWCLK,PA30
|
||||||
|
SWDIO,PA31
|
|
|
@ -56,14 +56,14 @@ void mp_obj_fun_bc_attr(mp_obj_t self_in, qstr attr, mp_obj_t *dest);
|
||||||
#if MICROPY_EMIT_NATIVE
|
#if MICROPY_EMIT_NATIVE
|
||||||
|
|
||||||
static inline mp_obj_t mp_obj_new_fun_native(const mp_obj_t *def_args, const void *fun_data, const mp_module_context_t *mc, struct _mp_raw_code_t *const *child_table) {
|
static inline mp_obj_t mp_obj_new_fun_native(const mp_obj_t *def_args, const void *fun_data, const mp_module_context_t *mc, struct _mp_raw_code_t *const *child_table) {
|
||||||
mp_obj_fun_bc_t *o = MP_OBJ_TO_PTR(mp_obj_new_fun_bc(def_args, (const byte *)fun_data, mc, child_table));
|
mp_obj_fun_bc_t *o = (mp_obj_fun_bc_t *)MP_OBJ_TO_PTR(mp_obj_new_fun_bc(def_args, (const byte *)fun_data, mc, child_table));
|
||||||
o->base.type = &mp_type_fun_native;
|
o->base.type = &mp_type_fun_native;
|
||||||
return MP_OBJ_FROM_PTR(o);
|
return MP_OBJ_FROM_PTR(o);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline mp_obj_t mp_obj_new_fun_viper(const void *fun_data, const mp_module_context_t *mc, struct _mp_raw_code_t *const *child_table) {
|
static inline mp_obj_t mp_obj_new_fun_viper(const void *fun_data, const mp_module_context_t *mc, struct _mp_raw_code_t *const *child_table) {
|
||||||
mp_obj_fun_bc_t *o = mp_obj_malloc(mp_obj_fun_bc_t, &mp_type_fun_viper);
|
mp_obj_fun_bc_t *o = mp_obj_malloc(mp_obj_fun_bc_t, &mp_type_fun_viper);
|
||||||
o->bytecode = fun_data;
|
o->bytecode = (const byte *)fun_data;
|
||||||
o->context = mc;
|
o->context = mc;
|
||||||
o->child_table = child_table;
|
o->child_table = child_table;
|
||||||
return MP_OBJ_FROM_PTR(o);
|
return MP_OBJ_FROM_PTR(o);
|
||||||
|
@ -101,9 +101,9 @@ static inline void *mp_obj_fun_native_get_generator_resume(const mp_obj_fun_bc_t
|
||||||
|
|
||||||
#if MICROPY_EMIT_INLINE_ASM
|
#if MICROPY_EMIT_INLINE_ASM
|
||||||
static inline mp_obj_t mp_obj_new_fun_asm(size_t n_args, const void *fun_data, mp_uint_t type_sig) {
|
static inline mp_obj_t mp_obj_new_fun_asm(size_t n_args, const void *fun_data, mp_uint_t type_sig) {
|
||||||
mp_obj_fun_asm_t *o = mp_obj_malloc(mp_obj_fun_asm_t, &mp_type_fun_asm);
|
mp_obj_fun_asm_t *o = (mp_obj_fun_asm_t *)mp_obj_malloc(mp_obj_fun_asm_t, &mp_type_fun_asm);
|
||||||
o->n_args = n_args;
|
o->n_args = n_args;
|
||||||
o->fun_data = fun_data;
|
o->fun_data = (const byte *)fun_data;
|
||||||
o->type_sig = type_sig;
|
o->type_sig = type_sig;
|
||||||
return MP_OBJ_FROM_PTR(o);
|
return MP_OBJ_FROM_PTR(o);
|
||||||
}
|
}
|
||||||
|
|
Ładowanie…
Reference in New Issue