Merge pull request #3807 from tannewt/sleep_tweaks

Add `board_deinit` for use with sleep
This commit is contained in:
Scott Shawcroft 2020-12-08 16:30:41 -08:00 committed by GitHub
commit 57101d7da6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
250 changed files with 596 additions and 693 deletions

View File

@ -265,7 +265,7 @@ update-frozen-libraries:
@echo "Updating all frozen libraries to latest tagged version."
cd frozen; for library in *; do cd $$library; ../../tools/git-checkout-latest-tag.sh; cd ..; done
one-of-each: samd21 samd51 esp32s2 litex mimxrt10xx nrf stm
one-of-each: samd21 litex mimxrt10xx nrf stm
samd21:
$(MAKE) -C ports/atmel-samd BOARD=trinket_m0

View File

@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-11-27 23:57-0500\n"
"POT-Creation-Date: 2020-12-08 09:56-0800\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@ -498,8 +498,8 @@ msgstr ""
msgid "Buffer must be a multiple of 512 bytes"
msgstr ""
#: shared-bindings/bitbangio/I2C.c shared-bindings/busdevice/I2CDevice.c
#: shared-bindings/busio/I2C.c
#: shared-bindings/adafruit_bus_device/I2CDevice.c
#: shared-bindings/bitbangio/I2C.c shared-bindings/busio/I2C.c
msgid "Buffer must be at least length 1"
msgstr ""
@ -1296,7 +1296,7 @@ msgstr ""
msgid "No DMA channel found"
msgstr ""
#: shared-module/busdevice/I2CDevice.c
#: shared-module/adafruit_bus_device/I2CDevice.c
#, c-format
msgid "No I2C device at address: %x"
msgstr ""
@ -1503,6 +1503,7 @@ msgstr ""
msgid "Pin does not have ADC capabilities"
msgstr ""
#: shared-bindings/adafruit_bus_device/SPIDevice.c
#: shared-bindings/digitalio/DigitalInOut.c
msgid "Pin is input only"
msgstr ""
@ -1555,7 +1556,11 @@ msgid "Prefix buffer must be on the heap"
msgstr ""
#: main.c
msgid "Press any key to enter the REPL. Use CTRL-D to reload."
msgid "Press any key to enter the REPL. Use CTRL-D to reload.\n"
msgstr ""
#: main.c
msgid "Pretending to deep sleep until alarm, any key or file write.\n"
msgstr ""
#: shared-bindings/digitalio/DigitalInOut.c
@ -2026,6 +2031,10 @@ msgstr ""
msgid "WiFi password must be between 8 and 63 characters"
msgstr ""
#: main.c
msgid "Woken up by alarm.\n"
msgstr ""
#: ports/nrf/common-hal/_bleio/PacketBuffer.c
msgid "Writes not supported on Characteristic"
msgstr ""

79
main.c
View File

@ -46,6 +46,7 @@
#include "background.h"
#include "mpconfigboard.h"
#include "supervisor/background_callback.h"
#include "supervisor/board.h"
#include "supervisor/cpu.h"
#include "supervisor/filesystem.h"
#include "supervisor/memory.h"
@ -64,8 +65,6 @@
#include "shared-bindings/microcontroller/Processor.h"
#include "shared-bindings/supervisor/Runtime.h"
#include "boards/board.h"
#if CIRCUITPY_ALARM
#include "shared-bindings/alarm/__init__.h"
#endif
@ -303,13 +302,6 @@ STATIC bool run_code_py(safe_mode_t safe_mode) {
if (result.return_code & PYEXEC_FORCED_EXIT) {
return reload_requested;
}
#if CIRCUITPY_ALARM
if (result.return_code & PYEXEC_DEEP_SLEEP) {
common_hal_alarm_enter_deep_sleep();
// Does not return.
}
#endif
}
// Program has finished running.
@ -326,24 +318,47 @@ STATIC bool run_code_py(safe_mode_t safe_mode) {
rgb_status_animation_t animation;
prep_rgb_status_animation(&result, found_main, safe_mode, &animation);
bool asleep = false;
while (true) {
RUN_BACKGROUND_TASKS;
if (reload_requested) {
#if CIRCUITPY_ALARM
if (asleep) {
board_init();
}
#endif
supervisor_set_run_reason(RUN_REASON_AUTO_RELOAD);
reload_requested = false;
return true;
}
if (serial_connected() && serial_bytes_available()) {
#if CIRCUITPY_ALARM
if (asleep) {
board_init();
}
#endif
// Skip REPL if reload was requested.
bool ctrl_d = serial_read() == CHAR_CTRL_D;
if (ctrl_d) {
supervisor_set_run_reason(RUN_REASON_REPL_RELOAD);
}
return (ctrl_d);
return ctrl_d;
}
// Check for a deep sleep alarm and restart the VM. This can happen if
// an alarm alerts faster than our USB delay or if we pretended to deep
// sleep.
#if CIRCUITPY_ALARM
if (asleep && alarm_woken_from_sleep()) {
serial_write_compressed(translate("Woken up by alarm.\n"));
board_init();
supervisor_set_run_reason(RUN_REASON_STARTUP);
// TODO: Reset any volatile memory the user may have access to.
return true;
}
#endif
if (!serial_connected_before_animation && serial_connected()) {
if (!serial_connected_at_start) {
print_code_py_status_message(safe_mode);
@ -351,7 +366,7 @@ STATIC bool run_code_py(safe_mode_t safe_mode) {
print_safe_mode_message(safe_mode);
serial_write("\n");
serial_write_compressed(translate("Press any key to enter the REPL. Use CTRL-D to reload."));
serial_write_compressed(translate("Press any key to enter the REPL. Use CTRL-D to reload.\n"));
}
if (serial_connected_before_animation && !serial_connected()) {
serial_connected_at_start = false;
@ -360,12 +375,52 @@ STATIC bool run_code_py(safe_mode_t safe_mode) {
// Refresh the ePaper display if we have one. That way it'll show an error message.
#if CIRCUITPY_DISPLAYIO
// Don't refresh the display if we're about to deep sleep.
#if CIRCUITPY_ALARM
refreshed_epaper_display = refreshed_epaper_display || result.return_code & PYEXEC_DEEP_SLEEP;
#endif
if (!refreshed_epaper_display) {
refreshed_epaper_display = maybe_refresh_epaperdisplay();
}
#endif
// Sleep until our next interrupt.
#if CIRCUITPY_ALARM
if (result.return_code & PYEXEC_DEEP_SLEEP) {
// Make sure we have been awake long enough for USB to connect (enumeration delay).
int64_t connecting_delay_ticks = CIRCUITPY_USB_CONNECTED_SLEEP_DELAY * 1024 - port_get_raw_ticks(NULL);
if (connecting_delay_ticks > 0) {
// Set when we've waited long enough so that we wake up from the
// port_idle_until_interrupt below and loop around to the real deep
// sleep in the else clause.
port_interrupt_after_ticks(connecting_delay_ticks);
// Deep sleep if we're not connected to a host.
} else if (!asleep) {
asleep = true;
new_status_color(BLACK);
board_deinit();
if (!supervisor_workflow_active()) {
// Enter true deep sleep. When we wake up we'll be back at the
// top of main(), not in this loop.
alarm_enter_deep_sleep();
// Does not return.
} else {
serial_write_compressed(translate("Pretending to deep sleep until alarm, any key or file write.\n"));
}
}
}
#endif
if (!asleep) {
tick_rgb_status_animation(&animation);
} else {
// This waits until a pretend deep sleep alarm occurs. They are set
// during common_hal_alarm_set_deep_sleep_alarms. On some platforms
// it may also return due to another interrupt, that's why we check
// for deep sleep alarms above. If it wasn't a deep sleep alarm,
// then we'll idle here again.
port_idle_until_interrupt();
}
}
}

View File

@ -24,7 +24,7 @@
* THE SOFTWARE.
*/
#include "boards/board.h"
#include "supervisor/board.h"
void board_init(void) {
}

View File

@ -28,7 +28,7 @@
// Author: Bryan Craker
// Date: 2020-05-20
#include "boards/board.h"
#include "supervisor/board.h"
#include "mpconfigboard.h"
void board_init(void) {

View File

@ -24,7 +24,7 @@
* THE SOFTWARE.
*/
#include "boards/board.h"
#include "supervisor/board.h"
#include "mpconfigboard.h"
#include "hal/include/hal_gpio.h"

View File

@ -24,7 +24,7 @@
* THE SOFTWARE.
*/
#include "boards/board.h"
#include "supervisor/board.h"
#include "mpconfigboard.h"
#include "hal/include/hal_gpio.h"

View File

@ -24,7 +24,7 @@
* THE SOFTWARE.
*/
#include "boards/board.h"
#include "supervisor/board.h"
#include "mpconfigboard.h"
#include "hal/include/hal_gpio.h"

View File

@ -24,7 +24,7 @@
* THE SOFTWARE.
*/
#include "boards/board.h"
#include "supervisor/board.h"
#include "mpconfigboard.h"
#include "hal/include/hal_gpio.h"

View File

@ -24,7 +24,7 @@
* THE SOFTWARE.
*/
#include "boards/board.h"
#include "supervisor/board.h"
void board_init(void)
{

View File

@ -24,7 +24,7 @@
* THE SOFTWARE.
*/
#include "boards/board.h"
#include "supervisor/board.h"
#include "mpconfigboard.h"
void board_init(void)

View File

@ -24,7 +24,7 @@
* THE SOFTWARE.
*/
#include "boards/board.h"
#include "supervisor/board.h"
#include "mpconfigboard.h"
void board_init(void)

View File

@ -24,7 +24,7 @@
* THE SOFTWARE.
*/
#include "boards/board.h"
#include "supervisor/board.h"
#include "supervisor/shared/board.h"
void board_init(void) {
@ -35,5 +35,5 @@ bool board_requests_safe_mode(void) {
}
void reset_board(void) {
board_reset_user_neopixels();
board_reset_user_neopixels(&pin_PA05, 10);
}

View File

@ -13,8 +13,6 @@
#define DEFAULT_UART_BUS_RX (&pin_PA01)
#define DEFAULT_UART_BUS_TX (&pin_PA00)
#define USER_NEOPIXELS_PIN (&pin_PA05)
#define IGNORE_PIN_PA09 1
#define IGNORE_PIN_PA12 1
#define IGNORE_PIN_PA13 1

View File

@ -1,47 +0,0 @@
/*
* This file is part of the MicroPython project, http://micropython.org/
*
* The MIT License (MIT)
*
* Copyright (c) 2017 Scott Shawcroft for Adafruit Industries
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
// This file defines board specific functions.
#ifndef MICROPY_INCLUDED_ATMEL_SAMD_BOARDS_BOARD_H
#define MICROPY_INCLUDED_ATMEL_SAMD_BOARDS_BOARD_H
#include <stdbool.h>
#include "py/mpconfig.h"
// Initializes board related state once on start up.
void board_init(void);
// Returns true if the user initiates safe mode in a board specific way.
// Also add BOARD_USER_SAFE_MODE in mpconfigboard.h to explain the board specific
// way.
bool board_requests_safe_mode(void);
// Reset the state of off MCU components such as neopixels.
void reset_board(void);
#endif // MICROPY_INCLUDED_ATMEL_SAMD_BOARDS_BOARD_H

View File

@ -24,7 +24,7 @@
* THE SOFTWARE.
*/
#include "boards/board.h"
#include "supervisor/board.h"
#include "mpconfigboard.h"
#include "hal/include/hal_gpio.h"
#include "common-hal/microcontroller/Pin.h"

View File

@ -24,7 +24,7 @@
* THE SOFTWARE.
*/
#include "boards/board.h"
#include "supervisor/board.h"
void board_init(void)
{

View File

@ -25,7 +25,7 @@
* THE SOFTWARE.
*/
#include "boards/board.h"
#include "supervisor/board.h"
#include "mpconfigboard.h"
#include "hal/include/hal_gpio.h"

View File

@ -25,7 +25,7 @@
* THE SOFTWARE.
*/
#include "boards/board.h"
#include "supervisor/board.h"
#include "mpconfigboard.h"
#include "hal/include/hal_gpio.h"

View File

@ -26,7 +26,7 @@
#include <string.h>
#include "boards/board.h"
#include "supervisor/board.h"
#include "common-hal/microcontroller/Pin.h"
#include "supervisor/shared/board.h"
#include "hal/include/hal_gpio.h"
@ -53,5 +53,5 @@ bool board_requests_safe_mode(void) {
}
void reset_board(void) {
board_reset_user_neopixels();
board_reset_user_neopixels(&pin_PB23, 10);
}

View File

@ -30,8 +30,6 @@
// Increase stack size slightly due to CPX library import nesting
#define CIRCUITPY_DEFAULT_STACK_SIZE (4248) //divisible by 8
#define USER_NEOPIXELS_PIN (&pin_PB23)
#define DEFAULT_I2C_BUS_SCL (&pin_PB03)
#define DEFAULT_I2C_BUS_SDA (&pin_PB02)

View File

@ -26,7 +26,7 @@
#include <string.h>
#include "boards/board.h"
#include "supervisor/board.h"
#include "common-hal/microcontroller/Pin.h"
#include "hal/include/hal_gpio.h"
#include "supervisor/shared/board.h"
@ -53,5 +53,5 @@ bool board_requests_safe_mode(void) {
}
void reset_board(void) {
board_reset_user_neopixels();
board_reset_user_neopixels(&pin_PB23, 10);
}

View File

@ -24,8 +24,6 @@
#define CALIBRATE_CRYSTALLESS 1
#define USER_NEOPIXELS_PIN (&pin_PB23)
// Explanation of how a user got into safe mode.
#define BOARD_USER_SAFE_MODE_ACTION translate("pressing both buttons at start up.\n")

View File

@ -26,7 +26,7 @@
#include <string.h>
#include "boards/board.h"
#include "supervisor/board.h"
#include "common-hal/microcontroller/Pin.h"
#include "hal/include/hal_gpio.h"
#include "supervisor/shared/board.h"
@ -53,5 +53,5 @@ bool board_requests_safe_mode(void) {
}
void reset_board(void) {
board_reset_user_neopixels();
board_reset_user_neopixels(&pin_PB23, 10);
}

View File

@ -30,8 +30,6 @@
// Increase stack size slightly due to CPX library import nesting.
#define CIRCUITPY_DEFAULT_STACK_SIZE (4248) // divisible by 8
#define USER_NEOPIXELS_PIN (&pin_PB23)
#define DEFAULT_I2C_BUS_SCL (&pin_PB03)
#define DEFAULT_I2C_BUS_SDA (&pin_PB02)

View File

@ -24,7 +24,7 @@
* THE SOFTWARE.
*/
#include "boards/board.h"
#include "supervisor/board.h"
#include "mpconfigboard.h"
#include "hal/include/hal_gpio.h"

View File

@ -24,7 +24,7 @@
* THE SOFTWARE.
*/
#include "boards/board.h"
#include "supervisor/board.h"
#include "common-hal/microcontroller/Pin.h"
#include "supervisor/shared/board.h"
#include "hal/include/hal_gpio.h"

View File

@ -24,7 +24,7 @@
* THE SOFTWARE.
*/
#include "boards/board.h"
#include "supervisor/board.h"
#include "common-hal/microcontroller/Pin.h"
#include "supervisor/shared/board.h"
#include "hal/include/hal_gpio.h"

View File

@ -24,7 +24,7 @@
* THE SOFTWARE.
*/
#include "boards/board.h"
#include "supervisor/board.h"
#include "mpconfigboard.h"
#include "hal/include/hal_gpio.h"

View File

@ -24,7 +24,7 @@
* THE SOFTWARE.
*/
#include "boards/board.h"
#include "supervisor/board.h"
void board_init(void)
{

View File

@ -24,7 +24,7 @@
* THE SOFTWARE.
*/
#include "boards/board.h"
#include "supervisor/board.h"
void board_init(void)
{

View File

@ -24,7 +24,7 @@
* THE SOFTWARE.
*/
#include "boards/board.h"
#include "supervisor/board.h"
void board_init(void)
{

View File

@ -24,7 +24,7 @@
* THE SOFTWARE.
*/
#include "boards/board.h"
#include "supervisor/board.h"
void board_init(void)
{

View File

@ -24,7 +24,7 @@
* THE SOFTWARE.
*/
#include "boards/board.h"
#include "supervisor/board.h"
void board_init(void)
{

View File

@ -24,7 +24,7 @@
* THE SOFTWARE.
*/
#include "boards/board.h"
#include "supervisor/board.h"
void board_init(void)
{

View File

@ -24,7 +24,7 @@
* THE SOFTWARE.
*/
#include "boards/board.h"
#include "supervisor/board.h"
void board_init(void)
{

View File

@ -24,7 +24,7 @@
* THE SOFTWARE.
*/
#include "boards/board.h"
#include "supervisor/board.h"
void board_init(void)
{

View File

@ -24,7 +24,7 @@
* THE SOFTWARE.
*/
#include "boards/board.h"
#include "supervisor/board.h"
void board_init(void)
{

View File

@ -24,7 +24,7 @@
* THE SOFTWARE.
*/
#include "boards/board.h"
#include "supervisor/board.h"
void board_init(void)
{

View File

@ -24,7 +24,7 @@
* THE SOFTWARE.
*/
#include "boards/board.h"
#include "supervisor/board.h"
void board_init(void)
{

View File

@ -24,7 +24,7 @@
* THE SOFTWARE.
*/
#include "boards/board.h"
#include "supervisor/board.h"
void board_init(void)
{

View File

@ -24,7 +24,7 @@
* THE SOFTWARE.
*/
#include "boards/board.h"
#include "supervisor/board.h"
void board_init(void)
{

View File

@ -24,7 +24,7 @@
* THE SOFTWARE.
*/
#include "boards/board.h"
#include "supervisor/board.h"
void board_init(void)
{

View File

@ -24,7 +24,7 @@
* THE SOFTWARE.
*/
#include "boards/board.h"
#include "supervisor/board.h"
#include "mpconfigboard.h"
void board_init(void) {

View File

@ -24,7 +24,7 @@
* THE SOFTWARE.
*/
#include "boards/board.h"
#include "supervisor/board.h"
#include "mpconfigboard.h"
void board_init(void) {

View File

@ -24,7 +24,7 @@
* THE SOFTWARE.
*/
#include "boards/board.h"
#include "supervisor/board.h"
void board_init(void)
{

View File

@ -24,7 +24,7 @@
* THE SOFTWARE.
*/
#include "boards/board.h"
#include "supervisor/board.h"
void board_init(void)
{

View File

@ -24,7 +24,7 @@
* THE SOFTWARE.
*/
#include "boards/board.h"
#include "supervisor/board.h"
void board_init(void)
{

View File

@ -24,7 +24,7 @@
* THE SOFTWARE.
*/
#include "boards/board.h"
#include "supervisor/board.h"
#include "mpconfigboard.h"
#include "hal/include/hal_gpio.h"

View File

@ -24,7 +24,7 @@
* THE SOFTWARE.
*/
#include "boards/board.h"
#include "supervisor/board.h"
#include "shared-bindings/board/__init__.h"
#include "shared-bindings/displayio/FourWire.h"

View File

@ -1,6 +1,6 @@
#include "shared-bindings/board/__init__.h"
#include "boards/board.h"
#include "supervisor/board.h"
#include "shared-module/displayio/__init__.h"
STATIC const mp_rom_map_elem_t board_global_dict_table[] = {

View File

@ -24,7 +24,7 @@
* THE SOFTWARE.
*/
#include "boards/board.h"
#include "supervisor/board.h"
#include "mpconfigboard.h"
#include "hal/include/hal_gpio.h"
#include "shared-bindings/busio/SPI.h"

View File

@ -24,7 +24,7 @@
* THE SOFTWARE.
*/
#include "boards/board.h"
#include "supervisor/board.h"
void board_init(void) {
}

View File

@ -24,7 +24,7 @@
* THE SOFTWARE.
*/
#include "boards/board.h"
#include "supervisor/board.h"
#include "mpconfigboard.h"
#include "hal/include/hal_gpio.h"

View File

@ -27,7 +27,7 @@
#include <string.h>
#include "boards/board.h"
#include "supervisor/board.h"
#include "py/mpconfig.h"
void board_init(void) {

View File

@ -1,5 +1,5 @@
#include "shared-bindings/board/__init__.h"
#include "boards/board.h"
#include "supervisor/board.h"
STATIC const mp_rom_map_elem_t board_global_dict_table[] = {
{ MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_PA05) },

View File

@ -24,7 +24,7 @@
* THE SOFTWARE.
*/
#include "boards/board.h"
#include "supervisor/board.h"
#include "mpconfigboard.h"
#include "hal/include/hal_gpio.h"

View File

@ -24,7 +24,7 @@
* THE SOFTWARE.
*/
#include "boards/board.h"
#include "supervisor/board.h"
#include "mpconfigboard.h"
#include "hal/include/hal_gpio.h"

View File

@ -24,7 +24,7 @@
* THE SOFTWARE.
*/
#include "boards/board.h"
#include "supervisor/board.h"
void board_init(void)
{

View File

@ -24,7 +24,7 @@
* THE SOFTWARE.
*/
#include "boards/board.h"
#include "supervisor/board.h"
#include "mpconfigboard.h"
void board_init(void)

View File

@ -24,7 +24,7 @@
* THE SOFTWARE.
*/
#include "boards/board.h"
#include "supervisor/board.h"
#include "mpconfigboard.h"
#include "hal/include/hal_gpio.h"

View File

@ -24,7 +24,7 @@
* THE SOFTWARE.
*/
#include "boards/board.h"
#include "supervisor/board.h"
#include "mpconfigboard.h"
#include "hal/include/hal_gpio.h"

View File

@ -24,7 +24,7 @@
* THE SOFTWARE.
*/
#include "boards/board.h"
#include "supervisor/board.h"
#include "mpconfigboard.h"
#include "hal/include/hal_gpio.h"

View File

@ -24,7 +24,7 @@
* THE SOFTWARE.
*/
#include "boards/board.h"
#include "supervisor/board.h"
#include "mpconfigboard.h"
#include "hal/include/hal_gpio.h"
#include "shared-bindings/busio/SPI.h"

View File

@ -1,6 +1,6 @@
#include "shared-bindings/board/__init__.h"
#include "boards/board.h"
#include "supervisor/board.h"
#include "shared-module/displayio/__init__.h"
STATIC const mp_rom_map_elem_t board_global_dict_table[] = {

View File

@ -24,7 +24,7 @@
* THE SOFTWARE.
*/
#include "boards/board.h"
#include "supervisor/board.h"
#include "mpconfigboard.h"
#include "hal/include/hal_gpio.h"

View File

@ -24,7 +24,7 @@
* THE SOFTWARE.
*/
#include "boards/board.h"
#include "supervisor/board.h"
#include "mpconfigboard.h"
#include "hal/include/hal_gpio.h"

View File

@ -24,7 +24,7 @@
* THE SOFTWARE.
*/
#include "boards/board.h"
#include "supervisor/board.h"
void board_init(void)
{

View File

@ -24,7 +24,7 @@
* THE SOFTWARE.
*/
#include "boards/board.h"
#include "supervisor/board.h"
#include "mpconfigboard.h"
#include "hal/include/hal_gpio.h"
#include "shared-bindings/busio/SPI.h"

View File

@ -1,6 +1,6 @@
#include "shared-bindings/board/__init__.h"
#include "boards/board.h"
#include "supervisor/board.h"
#include "shared-module/displayio/__init__.h"
STATIC const mp_rom_map_elem_t board_global_dict_table[] = {

View File

@ -24,7 +24,7 @@
* THE SOFTWARE.
*/
#include "boards/board.h"
#include "supervisor/board.h"
void board_init(void) {
}

View File

@ -25,7 +25,7 @@
* THE SOFTWARE.
*/
#include "boards/board.h"
#include "supervisor/board.h"
#include "mpconfigboard.h"
#include "hal/include/hal_gpio.h"
#include "shared-bindings/busio/SPI.h"

View File

@ -24,7 +24,7 @@
* THE SOFTWARE.
*/
#include "boards/board.h"
#include "supervisor/board.h"
void board_init(void) {
}

View File

@ -24,7 +24,7 @@
* THE SOFTWARE.
*/
#include "boards/board.h"
#include "supervisor/board.h"
void board_init(void)
{

View File

@ -24,7 +24,7 @@
* THE SOFTWARE.
*/
#include "boards/board.h"
#include "supervisor/board.h"
#include "mpconfigboard.h"
#include "hal/include/hal_gpio.h"
#include "shared-bindings/busio/SPI.h"
@ -123,5 +123,5 @@ bool board_requests_safe_mode(void) {
}
void reset_board(void) {
board_reset_user_neopixels();
board_reset_user_neopixels(&pin_PA15, 5);
}

View File

@ -14,8 +14,6 @@
#define MICROPY_PORT_C (0)
#define MICROPY_PORT_D (0)
#define USER_NEOPIXELS_PIN (&pin_PA15)
#define DEFAULT_I2C_BUS_SCL (&pin_PA13)
#define DEFAULT_I2C_BUS_SDA (&pin_PA12)

View File

@ -1,6 +1,6 @@
#include "shared-bindings/board/__init__.h"
#include "boards/board.h"
#include "supervisor/board.h"
#include "shared-module/displayio/__init__.h"
STATIC const mp_rom_map_elem_t board_global_dict_table[] = {

View File

@ -24,7 +24,7 @@
* THE SOFTWARE.
*/
#include "boards/board.h"
#include "supervisor/board.h"
#include "mpconfigboard.h"
#include "hal/include/hal_gpio.h"
#include "shared-bindings/busio/SPI.h"
@ -101,5 +101,5 @@ bool board_requests_safe_mode(void) {
}
void reset_board(void) {
board_reset_user_neopixels();
board_reset_user_neopixels(&pin_PA15, 5);
}

View File

@ -14,8 +14,6 @@
#define MICROPY_PORT_C (0)
#define MICROPY_PORT_D (0)
#define USER_NEOPIXELS_PIN (&pin_PA15)
#define DEFAULT_I2C_BUS_SCL (&pin_PA13)
#define DEFAULT_I2C_BUS_SDA (&pin_PA12)

View File

@ -1,6 +1,6 @@
#include "shared-bindings/board/__init__.h"
#include "boards/board.h"
#include "supervisor/board.h"
#include "shared-module/displayio/__init__.h"
STATIC const mp_rom_map_elem_t board_global_dict_table[] = {

View File

@ -27,7 +27,7 @@
#include <string.h>
#include "boards/board.h"
#include "supervisor/board.h"
#include "py/mpconfig.h"
#include "shared-bindings/nvm/ByteArray.h"
#include "common-hal/microcontroller/Pin.h"

View File

@ -1,5 +1,5 @@
#include "shared-bindings/board/__init__.h"
#include "boards/board.h"
#include "supervisor/board.h"
STATIC const mp_rom_map_elem_t board_global_dict_table[] = {
{ MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_PA13) },

View File

@ -27,7 +27,7 @@
#include <string.h>
#include "boards/board.h"
#include "supervisor/board.h"
#include "py/mpconfig.h"
#include "shared-bindings/nvm/ByteArray.h"
#include "common-hal/microcontroller/Pin.h"

View File

@ -1,5 +1,5 @@
#include "shared-bindings/board/__init__.h"
#include "boards/board.h"
#include "supervisor/board.h"
STATIC const mp_rom_map_elem_t board_global_dict_table[] = {
{ MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_PA13) },

View File

@ -24,7 +24,7 @@
* THE SOFTWARE.
*/
#include "boards/board.h"
#include "supervisor/board.h"
#include "mpconfigboard.h"
#include "hal/include/hal_gpio.h"
#include "shared-bindings/busio/SPI.h"
@ -123,5 +123,5 @@ bool board_requests_safe_mode(void) {
}
void reset_board(void) {
board_reset_user_neopixels();
board_reset_user_neopixels(&pin_PA15, 5);
}

View File

@ -13,8 +13,6 @@
#define MICROPY_PORT_C (0)
#define MICROPY_PORT_D (0)
#define USER_NEOPIXELS_PIN (&pin_PA15)
#define DEFAULT_I2C_BUS_SCL (&pin_PA13)
#define DEFAULT_I2C_BUS_SDA (&pin_PA12)

View File

@ -1,6 +1,6 @@
#include "shared-bindings/board/__init__.h"
#include "boards/board.h"
#include "supervisor/board.h"
#include "shared-module/displayio/__init__.h"
STATIC const mp_rom_map_elem_t board_global_dict_table[] = {

View File

@ -24,7 +24,7 @@
* THE SOFTWARE.
*/
#include "boards/board.h"
#include "supervisor/board.h"
#include "mpconfigboard.h"
#include "hal/include/hal_gpio.h"
#include "shared-bindings/busio/SPI.h"
@ -101,5 +101,5 @@ bool board_requests_safe_mode(void) {
}
void reset_board(void) {
board_reset_user_neopixels();
board_reset_user_neopixels(&pin_PA15, 5);
}

View File

@ -13,8 +13,6 @@
#define MICROPY_PORT_C (0)
#define MICROPY_PORT_D (0)
#define USER_NEOPIXELS_PIN (&pin_PA15)
#define DEFAULT_I2C_BUS_SCL (&pin_PA13)
#define DEFAULT_I2C_BUS_SDA (&pin_PA12)

View File

@ -1,6 +1,6 @@
#include "shared-bindings/board/__init__.h"
#include "boards/board.h"
#include "supervisor/board.h"
#include "shared-module/displayio/__init__.h"
STATIC const mp_rom_map_elem_t board_global_dict_table[] = {

View File

@ -24,7 +24,7 @@
* THE SOFTWARE.
*/
#include "boards/board.h"
#include "supervisor/board.h"
#include "mpconfigboard.h"
#include "hal/include/hal_gpio.h"

View File

@ -1,6 +1,6 @@
#include "shared-bindings/board/__init__.h"
#include "boards/board.h"
#include "supervisor/board.h"
#include "shared-module/displayio/__init__.h"
// This mapping only includes functional names because pins broken

View File

@ -24,7 +24,7 @@
* THE SOFTWARE.
*/
#include "boards/board.h"
#include "supervisor/board.h"
#include "mpconfigboard.h"
#include "hal/include/hal_gpio.h"

View File

@ -1,6 +1,6 @@
#include "shared-bindings/board/__init__.h"
#include "boards/board.h"
#include "supervisor/board.h"
#include "shared-module/displayio/__init__.h"
// This mapping only includes functional names because pins broken

View File

@ -24,7 +24,7 @@
* THE SOFTWARE.
*/
#include "boards/board.h"
#include "supervisor/board.h"
void board_init(void) {
}

View File

@ -24,7 +24,7 @@
* THE SOFTWARE.
*/
#include "boards/board.h"
#include "supervisor/board.h"
#include "common-hal/microcontroller/Pin.h"
#include "supervisor/shared/board.h"
#include "hal/include/hal_gpio.h"

View File

@ -24,7 +24,7 @@
* THE SOFTWARE.
*/
#include "boards/board.h"
#include "supervisor/board.h"
#include "common-hal/microcontroller/Pin.h"
#include "supervisor/shared/board.h"
#include "hal/include/hal_gpio.h"

View File

@ -24,7 +24,7 @@
* THE SOFTWARE.
*/
#include "boards/board.h"
#include "supervisor/board.h"
#include "mpconfigboard.h"
#include "hal/include/hal_gpio.h"

View File

@ -27,7 +27,7 @@
#include <string.h>
#include "boards/board.h"
#include "supervisor/board.h"
#include "py/mpconfig.h"
#include "common-hal/digitalio/DigitalInOut.h"

View File

@ -24,7 +24,7 @@
* THE SOFTWARE.
*/
#include "boards/board.h"
#include "supervisor/board.h"
#include "mpconfigboard.h"
#include "hal/include/hal_gpio.h"

Some files were not shown because too many files have changed in this diff Show More