|
@@ -1,4 +1,6 @@
|
|
|
#include "worker.h"
|
|
#include "worker.h"
|
|
|
|
|
+#include <furi_hal_resources.h>
|
|
|
|
|
+#include <furi.h>
|
|
|
|
|
|
|
|
bool killswitch = false;
|
|
bool killswitch = false;
|
|
|
|
|
|
|
@@ -178,12 +180,21 @@ static const NotificationSequence led_on = {
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
static const NotificationSequence led_off = {
|
|
static const NotificationSequence led_off = {
|
|
|
- &message_green_0,
|
|
|
|
|
|
|
+ &message_blue_0,
|
|
|
NULL,
|
|
NULL,
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
|
|
+void input_kill(void* _ctx) {
|
|
|
|
|
+ UNUSED(_ctx);
|
|
|
|
|
+ killswitch = true;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
void beginWorker(){
|
|
void beginWorker(){
|
|
|
status = 1;
|
|
status = 1;
|
|
|
|
|
+
|
|
|
|
|
+ //redefined from furi_hal_resources.c
|
|
|
|
|
+ const GpioPin gpio_button_back = {.port = GPIOC, .pin = LL_GPIO_PIN_13};
|
|
|
|
|
+
|
|
|
while (inst[instPtr] != 0x00) {
|
|
while (inst[instPtr] != 0x00) {
|
|
|
|
|
|
|
|
if(runOpCount % 500 == 0){
|
|
if(runOpCount % 500 == 0){
|
|
@@ -191,8 +202,16 @@ void beginWorker(){
|
|
|
notification_message(wrkrApp->notifications, &led_on);
|
|
notification_message(wrkrApp->notifications, &led_on);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ //status 2 indicates failure
|
|
|
if(status == 2){ status = 0; break; }
|
|
if(status == 2){ status = 0; break; }
|
|
|
- if(killswitch) {status = 0; killswitch = false; break; }
|
|
|
|
|
|
|
+
|
|
|
|
|
+ //read back button directly to avoid weirdness in furi
|
|
|
|
|
+ if(killswitch || !furi_hal_gpio_read(&gpio_button_back)) {
|
|
|
|
|
+ status = 0;
|
|
|
|
|
+ killswitch = false;
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
switch (inst[instPtr]) {
|
|
switch (inst[instPtr]) {
|
|
|
case '>':
|
|
case '>':
|
|
|
rShift();
|
|
rShift();
|