mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-05-06 00:35:09 -04:00
Added bias-T status icon
Merged radio settings in one screen
This commit is contained in:
parent
8b9ecda1a0
commit
3193c6ee99
152 changed files with 487 additions and 803 deletions
|
@ -1,64 +0,0 @@
|
|||
/*
|
||||
* Copyright (C) 2015 Jared Boone, ShareBrained Technology, Inc.
|
||||
* Copyright (C) 2016 Furrtek
|
||||
*
|
||||
* This file is part of PortaPack.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; see the file COPYING. If not, write to
|
||||
* the Free Software Foundation, Inc., 51 Franklin Street,
|
||||
* Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#include "ui_sd_wipe.hpp"
|
||||
|
||||
namespace ui {
|
||||
|
||||
WipeSDView::WipeSDView(NavigationView& nav) : nav_ (nav) {
|
||||
add_children({
|
||||
&text_info,
|
||||
&progress,
|
||||
&dummy
|
||||
});
|
||||
}
|
||||
|
||||
WipeSDView::~WipeSDView() {
|
||||
if (thread) chThdTerminate(thread);
|
||||
}
|
||||
|
||||
Thread* WipeSDView::thread { nullptr };
|
||||
|
||||
void WipeSDView::focus() {
|
||||
BlockDeviceInfo block_device_info;
|
||||
|
||||
dummy.focus();
|
||||
|
||||
if (!confirmed) {
|
||||
nav_.push<ModalMessageView>("Warning !", "Wipe first 32MB of SD card\n(filesystem included) ?", YESCANCEL, [this](bool choice) {
|
||||
if (choice)
|
||||
confirmed = true;
|
||||
}
|
||||
);
|
||||
} else {
|
||||
if (sdcGetInfo(&SDCD1, &block_device_info) == CH_SUCCESS) {
|
||||
blocks = 32; // Only erase first 32MB (block_device_info.blk_size * uint64_t(block_device_info.blk_num)) / (1024 * 1024);
|
||||
progress.set_max(blocks);
|
||||
|
||||
thread = chThdCreateFromHeap(NULL, 2048, NORMALPRIO + 10, WipeSDView::static_fn, this);
|
||||
} else {
|
||||
nav_.pop(); // Just silently abort for now
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
} /* namespace ui */
|
Loading…
Add table
Add a link
Reference in a new issue