Merge pull request 'board, hwconfig: Set POWER_EN in early boot' (#43) from fix-set-power-en-in-early-boot into main
All checks were successful
Build RPi Pico firmware image / Build-Firmware (push) Successful in 3m22s
Check code formatting / Check-C-Format (push) Successful in 8s
Check code formatting / Check-Python-Flake8 (push) Successful in 10s
Check code formatting / Check-Bash-Shellcheck (push) Successful in 5s
Run unit tests on host / Run-Unit-Tests (push) Successful in 8s
Run pytests / Check-Pytest (push) Successful in 11s
All checks were successful
Build RPi Pico firmware image / Build-Firmware (push) Successful in 3m22s
Check code formatting / Check-C-Format (push) Successful in 8s
Check code formatting / Check-Python-Flake8 (push) Successful in 10s
Check code formatting / Check-Bash-Shellcheck (push) Successful in 5s
Run unit tests on host / Run-Unit-Tests (push) Successful in 8s
Run pytests / Check-Pytest (push) Successful in 11s
Reviewed-on: #43 Reviewed-by: Stefan Kratochwil <kratochwil-la@gmx.de>
This commit was merged in pull request #43.
This commit is contained in:
@@ -25,3 +25,12 @@ int mp_hal_is_pin_reserved(int n);
|
||||
#define MICROPY_HW_PIN_RESERVED(i) mp_hal_is_pin_reserved(i)
|
||||
|
||||
#define MICROPY_PY_THREAD (0)
|
||||
|
||||
#define TONBERRY_POWER_EN 22
|
||||
|
||||
#define MICROPY_BOARD_STARTUP() \
|
||||
{ \
|
||||
gpio_init(TONBERRY_POWER_EN); \
|
||||
gpio_set_dir(TONBERRY_POWER_EN, true); \
|
||||
gpio_put(TONBERRY_POWER_EN, true); \
|
||||
}
|
||||
|
||||
@@ -41,10 +41,8 @@ VBAT_ADC = Pin.board.GP26
|
||||
|
||||
|
||||
def board_init():
|
||||
# Keep power turned on
|
||||
# POWER_EN turned on in MICROPY_BOARD_STARTUP
|
||||
# TODO: Implement soft power off
|
||||
POWER_EN.init(mode=Pin.OUT)
|
||||
POWER_EN.value(1)
|
||||
|
||||
# Set 8 mA drive strength and fast slew rate for SD SPI
|
||||
machine.mem32[0x4001c004 + 6*4] = 0x67
|
||||
|
||||
Reference in New Issue
Block a user