Formatted code (#1007)

* Updated style

* Updated files

* fixed new line

* Updated spacing

* File fix WIP

* Updated to clang 13

* updated comment style

* Removed old comment code
This commit is contained in:
jLynx 2023-05-19 08:16:05 +12:00 committed by GitHub
parent 7aca7ce74d
commit 033c4e9a5b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
599 changed files with 70746 additions and 66896 deletions

View file

@ -33,63 +33,60 @@
namespace ui {
class WipeSDView : public View {
public:
WipeSDView(NavigationView& nav);
~WipeSDView();
void focus() override;
std::string title() const override { return "Wipe sdcard"; };
public:
WipeSDView(NavigationView& nav);
~WipeSDView();
void focus() override;
private:
NavigationView& nav_;
bool confirmed = false;
static Thread* thread;
static msg_t static_fn(void* arg) {
auto obj = static_cast<WipeSDView*>(arg);
obj->run();
return 0;
}
void run() {
lfsr_word_t v = 1;
//DIR d;
const auto buffer = std::make_unique<std::array<uint8_t, 512>>();
std::string title() const override { return "Wipe sdcard"; };
//f_opendir(&d, (TCHAR*)u"");
private:
NavigationView& nav_;
uint32_t count = 512; //sd_card::fs.n_fats * sd_card::fs.fsize;
progress.set_max(count);
bool confirmed = false;
static Thread* thread;
for (uint32_t c = 0; c < count; c++) {
progress.set_value(c);
lfsr_fill(v,
reinterpret_cast<lfsr_word_t*>(buffer->data()),
sizeof(*buffer.get()) / sizeof(lfsr_word_t));
if (disk_write(sd_card::fs.drv, buffer->data(), sd_card::fs.fatbase + c, 1) != RES_OK)
break;
}
nav_.pop();
}
Text text_info {
{ 10 * 8, 16 * 8, 10 * 8, 16 },
"Working..."
};
ProgressBar progress {
{ 2 * 8, 19 * 8, 26 * 8, 24 }
};
Button dummy {
{ 240, 0, 0, 0 },
""
};
static msg_t static_fn(void* arg) {
auto obj = static_cast<WipeSDView*>(arg);
obj->run();
return 0;
}
void run() {
lfsr_word_t v = 1;
// DIR d;
const auto buffer = std::make_unique<std::array<uint8_t, 512>>();
// f_opendir(&d, (TCHAR*)u"");
uint32_t count = 512; // sd_card::fs.n_fats * sd_card::fs.fsize;
progress.set_max(count);
for (uint32_t c = 0; c < count; c++) {
progress.set_value(c);
lfsr_fill(v,
reinterpret_cast<lfsr_word_t*>(buffer->data()),
sizeof(*buffer.get()) / sizeof(lfsr_word_t));
if (disk_write(sd_card::fs.drv, buffer->data(), sd_card::fs.fatbase + c, 1) != RES_OK)
break;
}
nav_.pop();
}
Text text_info{
{10 * 8, 16 * 8, 10 * 8, 16},
"Working..."};
ProgressBar progress{
{2 * 8, 19 * 8, 26 * 8, 24}};
Button dummy{
{240, 0, 0, 0},
""};
};
} /* namespace ui */
#endif/*__UI_SD_WIPE_H__*/
#endif /*__UI_SD_WIPE_H__*/