more
This commit is contained in:
parent
645a172801
commit
279da41b1d
@ -30,7 +30,7 @@ STM32LIB_PATH = ../../external/micropython/lib
|
||||
TARGET_NAME = bootloader
|
||||
|
||||
# Source files. Important: Add them also to link-script.ld to control placement.
|
||||
OBJS += startup.o assets/screens.o
|
||||
OBJS += startup.o assets/q1_screens.o
|
||||
OBJS += firewall.o main.o dispatch.o verify.o clocks.o storage.o constant_time.o rng.o ae.o
|
||||
OBJS += delay.o gpio.o pins.o version.o console.o psram.o sdcard.o lcd.o
|
||||
OBJS += faster_sha256.o micro-ecc/uECC.o hal_glue.o se2.o aes.o
|
||||
@ -138,7 +138,7 @@ $(TARGET_ELF): $(OBJS) $(LINKER_SCRIPT) Makefile
|
||||
%.dfu: %.bin %.lss
|
||||
$(PYTHON_MAKE_DFU) -b $(BL_FLASH_BASE):$< $@
|
||||
|
||||
assets/screens.c: assets/Makefile assets/*.png assets/convert.py
|
||||
assets/q1_screens.c: assets/Makefile assets/*.png assets/convert.py
|
||||
(cd assets; $(MAKE))
|
||||
|
||||
|
||||
|
||||
@ -192,6 +192,7 @@ results = [
|
||||
( 'downgrade', 'Downgrade?', 'history', {} ),
|
||||
( 'corrupt', 'Firmware?', 'lemon', {} ),
|
||||
( 'logout', 'Logout Done', 'logout', {}),
|
||||
( 'poweroff', 'Power Off', 'power', {}),
|
||||
( 'devmode', 'Danger! Custom!', 'bomb-spook', dict(icon_xpos=0)), # was 2
|
||||
( 'red_light', 'Danger! Caution!', 'bomb-spook', dict(icon_xpos=0)), # was 2
|
||||
( 'upgrading', 'Upgrading', 'graph-up', {}),
|
||||
@ -206,7 +207,7 @@ results = [
|
||||
|
||||
if __name__ == '__main__':
|
||||
prefix = 'screen_';
|
||||
out = open("screens.c", 'wt')
|
||||
out = open("q1_screens.c", 'wt')
|
||||
out.write("// autogenerated by assets/convert.py\n\n")
|
||||
|
||||
bg = make_background()
|
||||
@ -230,7 +231,7 @@ if __name__ == '__main__':
|
||||
|
||||
out.close()
|
||||
|
||||
out = open("screens.h", 'wt')
|
||||
out = open("q1_screens.h", 'wt')
|
||||
out.write("// autogenerated by assets/convert.py\n\n")
|
||||
|
||||
for label, txt, icon, _ in results:
|
||||
|
||||
File diff suppressed because one or more lines are too long
@ -25,6 +25,9 @@ extern const unsigned char screen_corrupt[];
|
||||
extern const unsigned char screen_logout[];
|
||||
|
||||
|
||||
extern const unsigned char screen_poweroff[];
|
||||
|
||||
|
||||
extern const unsigned char screen_devmode[];
|
||||
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 6.0 KiB After Width: | Height: | Size: 6.4 KiB |
@ -78,21 +78,23 @@ gpio_setup(void)
|
||||
// Port C - Outputs
|
||||
// SD1 active LED: PC7
|
||||
// USB active LED: PC6
|
||||
// TURN OFF: PC0
|
||||
{ GPIO_InitTypeDef setup = {
|
||||
.Pin = GPIO_PIN_7 | GPIO_PIN_6,
|
||||
.Pin = GPIO_PIN_7 | GPIO_PIN_6 | GPIO_PIN_0,
|
||||
.Mode = GPIO_MODE_OUTPUT_PP,
|
||||
.Pull = GPIO_NOPULL,
|
||||
.Speed = GPIO_SPEED_FREQ_LOW,
|
||||
};
|
||||
HAL_GPIO_WritePin(GPIOC, GPIO_PIN_0, 0); // stay on!
|
||||
HAL_GPIO_Init(GPIOC, &setup);
|
||||
|
||||
HAL_GPIO_WritePin(GPIOC, GPIO_PIN_7|GPIO_PIN_6, 0); // turn LEDs off
|
||||
}
|
||||
|
||||
// Port C - Inputs
|
||||
// SD card detect switch: PC13
|
||||
// SD card detect switch: PC13, PC1 battery/not
|
||||
{ GPIO_InitTypeDef setup = {
|
||||
.Pin = GPIO_PIN_13,
|
||||
.Pin = GPIO_PIN_13 | GPIO_PIN_1,
|
||||
.Mode = GPIO_MODE_INPUT,
|
||||
.Pull = GPIO_PULLUP,
|
||||
.Speed = GPIO_SPEED_FREQ_LOW,
|
||||
@ -152,5 +154,18 @@ gpio_setup(void)
|
||||
#endif
|
||||
}
|
||||
|
||||
// turn_power_off()
|
||||
//
|
||||
// kill system power; instant
|
||||
//
|
||||
void
|
||||
turn_power_off(void)
|
||||
{
|
||||
gpio_setup();
|
||||
|
||||
HAL_GPIO_WritePin(GPIOC, GPIO_PIN_0, 1);
|
||||
|
||||
LOCKUP_FOREVER();
|
||||
}
|
||||
|
||||
// EOF
|
||||
|
||||
Loading…
Reference in New Issue
Block a user