minor adjustments. return instead of goto

This commit is contained in:
iceman1001 2017-09-28 22:30:33 +02:00
commit 1285f5a32c
4 changed files with 8 additions and 8 deletions

View file

@ -34,7 +34,7 @@ void RunMod() {
for (;;) { for (;;) {
WDT_HIT(); WDT_HIT();
// exit from Standalone Mode, send a usbcommand. // exit from Standalone Mode, send a usbcommand.
if (usb_poll_validate_length()) goto out; if (usb_poll_validate_length()) return;
SpinDelay(300); SpinDelay(300);
@ -52,7 +52,7 @@ void RunMod() {
for (;;) { for (;;) {
// exit from Standalone Mode, send a usbcommand. // exit from Standalone Mode, send a usbcommand.
if (usb_poll_validate_length()) goto out; if (usb_poll_validate_length()) return;
if (BUTTON_PRESS()) { if (BUTTON_PRESS()) {
if (cardRead[selected]) { if (cardRead[selected]) {
@ -201,7 +201,7 @@ void RunMod() {
DbpString("Playing"); DbpString("Playing");
for ( ; ; ) { for ( ; ; ) {
// exit from Standalone Mode, send a usbcommand. // exit from Standalone Mode, send a usbcommand.
if (usb_poll_validate_length()) goto out; if (usb_poll_validate_length()) return;
int button_action = BUTTON_HELD(1000); int button_action = BUTTON_HELD(1000);
if ( button_action == 0) { // No button action, proceed with sim if ( button_action == 0) { // No button action, proceed with sim
@ -258,6 +258,4 @@ void RunMod() {
LED(selected + 1, 0); LED(selected + 1, 0);
} }
} }
// time to exit standalone mode
out:
} }

View file

@ -31,7 +31,7 @@ void RunMod() {
// Was our button held down or pressed? // Was our button held down or pressed?
int button_pressed = BUTTON_HELD(1000); int button_pressed = BUTTON_HELD(1000);
SpinDelay(300); //SpinDelay(300);
// Button was held for a second, begin recording // Button was held for a second, begin recording
if (button_pressed > 0 && cardRead == 0) { if (button_pressed > 0 && cardRead == 0) {
@ -131,4 +131,4 @@ void RunMod() {
} }
} }
} }
} }

View file

@ -12,10 +12,11 @@
#ifndef __LF_SAMYRUN_H #ifndef __LF_SAMYRUN_H
#define __LF_SAMYRUN_H #define __LF_SAMYRUN_H
#include <stdbool.h> // for bool //#include <stdbool.h> // for bool
#include "standalone.h" // standalone definitions #include "standalone.h" // standalone definitions
#include "apps.h" // debugstatements, lfops? #include "apps.h" // debugstatements, lfops?
#define OPTS 2 #define OPTS 2
#endif /* __LF_SAMYRUN_H */ #endif /* __LF_SAMYRUN_H */

View file

@ -12,6 +12,7 @@
#define __STANDALONE_H #define __STANDALONE_H
#include <stdbool.h> // for bool #include <stdbool.h> // for bool
#include <inttypes.h> // PRIu64
extern void RunMod(); extern void RunMod();