Skip to content

Commit

Permalink
(#129) Enhance Warning
Browse files Browse the repository at this point in the history
  • Loading branch information
hijae authored and gkoh committed Oct 3, 2024
1 parent ecd0de4 commit 49360ca
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 17 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ To use:

WARNING:
* this will not be kind to battery life
* You must use the power button to shut down
* You must Forceful power off by holding the power button

## Motivation

Expand Down
31 changes: 15 additions & 16 deletions src/furble.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,6 @@ static uint64_t get_time_secs(void) {
return (esp_timer_get_time() / 1000000LL);
}

/**
* Progress bar update function.
*/
void update_progress_bar(void *ctx, float value) {
ezProgressBar *progress_bar = static_cast<ezProgressBar *>(ctx);
progress_bar->value(value);
}

/**
* Display the version.
*/
Expand Down Expand Up @@ -98,8 +90,6 @@ static void remote_control(FurbleCtx *fctx) {
do {
ez.yield();

// show_shutter_control(shutter_lock, shutter_lock_start_ms);

if (M5.BtnPWR.wasClicked() || M5.BtnC.wasPressed()) {
if (shutter_lock) {
// ensure shutter is released on exit
Expand Down Expand Up @@ -187,7 +177,10 @@ static uint16_t statusRefresh(void *context) {
FurbleCtx *fctx = static_cast<FurbleCtx *>(context);
auto *control = fctx->control;

static uint8_t reconnect_count = 0;

if (control->allConnected()) {
reconnect_count = 0;
furble_gps_update(control);
return 500;
}
Expand All @@ -196,13 +189,19 @@ static uint16_t statusRefresh(void *context) {
return 500;
}

bool reconnect = settings_load_reconnect();
auto buttons = ez.buttons.get();
std::string header = ez.header.title();

for (const auto &target : control->getTargets()) {
auto camera = target->getCamera();
if (!camera->isConnected()) {
if (!connect_with_progress(control, camera)) {
reconnect_count++;
if ((reconnect_count > 1) && !reconnect) {
fctx->cancelled = true;
}

if (!fctx->cancelled && !connect_with_progress(control, camera)) {
fctx->cancelled = true;
}
ez.screen.clear();
Expand Down Expand Up @@ -232,12 +231,12 @@ static void menu_remote(FurbleCtx *fctx) {
ez.addEvent(statusRefresh, fctx, 500);

do {
submenu.runOnce();

if (fctx->cancelled) {
break;
}

submenu.runOnce();

if (submenu.pickName() == "Shutter") {
remote_control(fctx);
}
Expand Down Expand Up @@ -443,13 +442,13 @@ static void menu_settings(void) {
submenu.buttons({"OK", "down"});
submenu.addItem("Backlight", "", ez.backlight.menu);
submenu.addItem("GPS", "", settings_menu_gps);
submenu.addItem("reconnectonoff",
std::string("Infinite-ReConnect\t") + (reconnect ? "ON" : "OFF"), nullptr,
&reconnect, reconnect_toggle);
submenu.addItem("Intervalometer", "", settings_menu_interval);
submenu.addItem("multiconnectonoff",
std::string("Multi-Connect\t") + (multiconnect ? "ON" : "OFF"), nullptr,
&multiconnect, multiconnect_toggle);
submenu.addItem("reconnectonoff",
std::string("Infinite-ReConnect\t") + (reconnect ? "ON" : "OFF"), nullptr,
&reconnect, reconnect_toggle);
submenu.addItem("Theme", "", ez.theme->menu);
submenu.addItem("Transmit Power", "", settings_menu_tx_power);
submenu.addItem("About", "", about);
Expand Down

0 comments on commit 49360ca

Please sign in to comment.