File tree Expand file tree Collapse file tree 2 files changed +10
-8
lines changed Expand file tree Collapse file tree 2 files changed +10
-8
lines changed Original file line number Diff line number Diff line change 4545#define PBDRV_CONFIG_BUTTON (1)
4646#define PBDRV_CONFIG_BUTTON_GPIO (1)
4747#define PBDRV_CONFIG_BUTTON_GPIO_NUM_BUTTON (6)
48+ #define PBDRV_CONFIG_BUTTON_INSTANT_RESET (0)
4849
4950#define PBDRV_CONFIG_DISPLAY (1)
5051#define PBDRV_CONFIG_DISPLAY_EV3 (1)
Original file line number Diff line number Diff line change 5555
5656#include <umm_malloc.h>
5757
58+ #include <pbio/port_interface.h>
59+ #include <pbio/button.h>
60+
5861#include <pbdrv/cache.h>
5962#include <pbdrv/compiler.h>
6063#include <pbdrv/ioport.h>
61- #include <pbio/port_interface .h>
64+ #include <pbdrv/reset .h>
6265
6366#include "exceptionhandler.h"
6467
@@ -852,18 +855,16 @@ void SystemInit(void) {
852855 umm_init_heap (& pb_umm_heap_start , & pb_umm_heap_end - & pb_umm_heap_start );
853856}
854857
855-
856- #include <pbio/button.h>
857- #include <pbdrv/reset.h>
858-
859858/*
860- * This is called from the IRQ handler after every systick. This should be
861- * removed when the final user interface is implemented. For now this serves
862- * as a very convenient way to power off the EV3 for fast iteration .
859+ * This is called from the IRQ handler after every systick. Can be enabled
860+ * to run emergency poweroff for faster iteration and debugging. User data
861+ * is not saved when powering off this way .
863862 */
864863void lazy_poweroff_hook (void ) {
864+ #if PBDRV_CONFIG_BUTTON_INSTANT_RESET
865865 if (pbdrv_button_get_pressed () & PBIO_BUTTON_LEFT_UP ) {
866866 pbdrv_reset_power_off ();
867867 return ;
868868 }
869+ #endif
869870}
You can’t perform that action at this time.
0 commit comments