Skip to content

Commit 0faba7f

Browse files
committed
BPP now via magical number 2
1 parent fa3936b commit 0faba7f

File tree

1 file changed

+20
-15
lines changed

1 file changed

+20
-15
lines changed

esp32/main.c

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -145,21 +145,17 @@ void app_main(void) {
145145
uint8_t inv_magic = esp_rtcmem_read(1);
146146

147147
#ifdef CONFIG_SHA_BPP_ENABLE
148-
//Grab level of int pin of touchpad. If high, this was a
149-
//scheduled wakeup because of a deep sleep timeout. If low,
150-
//the user used the touchpad.
151-
//yes, this is v1 specific. Please add v0.x support yourself.
152-
gpio_config_t io_conf = {
153-
.mode = GPIO_MODE_INPUT,
154-
.pin_bit_mask = 1LL << PIN_NUM_MPR121_INT,
155-
.pull_down_en = 0,
156-
.pull_up_en = 1,
157-
};
158-
gpio_config(&io_conf);
159-
if (gpio_get_level(PIN_NUM_MPR121_INT)==1) {
160-
printf("Touch int is high. Starting bpp.\n");
161-
do_bpp_bgnd();
162-
}
148+
//Grab level of int pin of touchpad. If high, this was a
149+
//scheduled wakeup because of a deep sleep timeout. If low,
150+
//the user used the touchpad.
151+
//yes, this is v1 specific. Please add v0.x support yourself.
152+
gpio_config_t io_conf = {
153+
.mode = GPIO_MODE_INPUT,
154+
.pin_bit_mask = 1LL << PIN_NUM_MPR121_INT,
155+
.pull_down_en = 0,
156+
.pull_up_en = 1,
157+
};
158+
gpio_config(&io_conf);
163159
#endif
164160

165161
if (magic == (uint8_t)~inv_magic) {
@@ -168,6 +164,15 @@ void app_main(void) {
168164
case 1:
169165
printf("Starting OTA\n");
170166
sha2017_ota_update();
167+
break;
168+
#ifdef CONFIG_SHA_BPP_ENABLE
169+
case 2:
170+
if (gpio_get_level(PIN_NUM_MPR121_INT)==1) {
171+
printf("Touch int is high. Starting bpp.\n");
172+
do_bpp_bgnd();
173+
}
174+
break;
175+
#endif
171176
}
172177
} else {
173178
xTaskCreateStaticPinnedToCore(mp_task, "mp_task", MP_TASK_STACK_LEN, NULL, MP_TASK_PRIORITY,

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy