Skip to content
This repository was archived by the owner on Oct 28, 2023. It is now read-only.

Commit ff39028

Browse files
committed
if (false) bpp component
1 parent a28fbda commit ff39028

File tree

1 file changed

+32
-30
lines changed

1 file changed

+32
-30
lines changed

esp32/main.c

Lines changed: 32 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -141,36 +141,38 @@ void do_bpp_bgnd() {
141141
void app_main(void) {
142142
badge_base_init();
143143

144-
uint8_t magic = esp_rtcmem_read(0);
145-
uint8_t inv_magic = esp_rtcmem_read(1);
146-
147-
// //Grab level of int pin of touchpad. If high, this was a
148-
// //scheduled wakeup because of a deep sleep timeout. If low,
149-
// //the user used the touchpad.
150-
// //yes, this is v1 specific. Please add v0.x support yourself.
151-
// gpio_config_t io_conf = {
152-
// .mode = GPIO_MODE_INPUT,
153-
// .pin_bit_mask = 1LL << PIN_NUM_MPR121_INT,
154-
// .pull_down_en = 0,
155-
// .pull_up_en = 1,
156-
// };
157-
// gpio_config(&io_conf);
158-
// if (gpio_get_level(PIN_NUM_MPR121_INT)==1) {
159-
// printf("Touch int is high. Starting bpp.\n");
160-
// do_bpp_bgnd();
161-
// }
162-
163-
if (magic == (uint8_t)~inv_magic) {
164-
printf("Magic checked out!\n");
165-
switch (magic) {
166-
case 1:
167-
printf("Starting OTA\n");
168-
sha2017_ota_update();
169-
}
170-
} else {
171-
xTaskCreateStaticPinnedToCore(mp_task, "mp_task", MP_TASK_STACK_LEN, NULL, MP_TASK_PRIORITY,
172-
&mp_task_stack[0], &mp_task_tcb, 0);
173-
}
144+
uint8_t magic = esp_rtcmem_read(0);
145+
uint8_t inv_magic = esp_rtcmem_read(1);
146+
147+
if (false) {
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+
}
163+
}
164+
165+
if (magic == (uint8_t)~inv_magic) {
166+
printf("Magic checked out!\n");
167+
switch (magic) {
168+
case 1:
169+
printf("Starting OTA\n");
170+
sha2017_ota_update();
171+
}
172+
} else {
173+
xTaskCreateStaticPinnedToCore(mp_task, "mp_task", MP_TASK_STACK_LEN, NULL, MP_TASK_PRIORITY,
174+
&mp_task_stack[0], &mp_task_tcb, 0);
175+
}
174176
}
175177

176178
void nlr_jump_fail(void *val) {

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