1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-22 07:28:10 +00:00

move APPVER guards from includes to app code

This commit is contained in:
Pavol Rusnak 2014-07-07 15:03:34 +02:00
parent df524b9f35
commit 2707e8aff6
5 changed files with 13 additions and 8 deletions

View File

@ -241,8 +241,10 @@ void usbInit(void)
int main(void)
{
#ifndef APPVER
setup();
oledInit();
#endif
usbInit();
passlen = strlen((char *)pass);

View File

@ -29,8 +29,12 @@
int main(void)
{
#ifndef APPVER
setup();
oledInit();
#else
setupApp();
#endif
// __stack_chk_guard_setup();
#if DEBUG_LINK
oledSetDebug(1);

4
oled.h
View File

@ -29,11 +29,7 @@
#define OLED_HEIGHT 64
#define OLED_BUFSIZE (OLED_WIDTH * OLED_HEIGHT / 8)
#ifdef APPVER
#define oledInit() do{}while(0)
#else
void oledInit(void);
#endif
void oledClear(void);
void oledRefresh(void);

View File

@ -66,3 +66,9 @@ void setup(void)
gpio_mode_setup(GPIOA, GPIO_MODE_AF, GPIO_PUPD_NONE, GPIO11 | GPIO12);
gpio_set_af(GPIOA, GPIO_AF10, GPIO11 | GPIO12);
}
void setupApp(void)
{
// hotfix for old bootloader
gpio_mode_setup(GPIOA, GPIO_MODE_INPUT, GPIO_PUPD_NONE, GPIO9);
}

View File

@ -20,10 +20,7 @@
#ifndef __SETUP_H__
#define __SETUP_H__
#ifdef APPVER
#define setup() do{}while(0)
#else
void setup(void);
#endif
void setupApp(void);
#endif