mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-06-29 09:07:17 -04:00
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:
parent
7aca7ce74d
commit
033c4e9a5b
599 changed files with 70746 additions and 66896 deletions
|
@ -33,10 +33,10 @@ namespace {
|
|||
|
||||
bool card_present = false;
|
||||
|
||||
Status status_ { Status::NotPresent };
|
||||
Status status_{Status::NotPresent};
|
||||
|
||||
FRESULT mount() {
|
||||
return f_mount(&fs, reinterpret_cast<const TCHAR*>(_T("")), 0);
|
||||
return f_mount(&fs, reinterpret_cast<const TCHAR*>(_T("")), 0);
|
||||
}
|
||||
|
||||
} /* namespace */
|
||||
|
@ -44,33 +44,33 @@ FRESULT mount() {
|
|||
Signal<Status> status_signal;
|
||||
|
||||
void poll_inserted() {
|
||||
const auto card_present_now = sdcIsCardInserted(&SDCD1);
|
||||
if( card_present_now != card_present ) {
|
||||
card_present = card_present_now;
|
||||
const auto card_present_now = sdcIsCardInserted(&SDCD1);
|
||||
if (card_present_now != card_present) {
|
||||
card_present = card_present_now;
|
||||
|
||||
Status new_status { card_present ? Status::Present : Status::NotPresent };
|
||||
Status new_status{card_present ? Status::Present : Status::NotPresent};
|
||||
|
||||
if( card_present ) {
|
||||
if( sdcConnect(&SDCD1) == CH_SUCCESS ) {
|
||||
if( mount() == FR_OK ) {
|
||||
new_status = Status::Mounted;
|
||||
} else {
|
||||
new_status = Status::MountError;
|
||||
}
|
||||
} else {
|
||||
new_status = Status::ConnectError;
|
||||
}
|
||||
} else {
|
||||
sdcDisconnect(&SDCD1);
|
||||
}
|
||||
if (card_present) {
|
||||
if (sdcConnect(&SDCD1) == CH_SUCCESS) {
|
||||
if (mount() == FR_OK) {
|
||||
new_status = Status::Mounted;
|
||||
} else {
|
||||
new_status = Status::MountError;
|
||||
}
|
||||
} else {
|
||||
new_status = Status::ConnectError;
|
||||
}
|
||||
} else {
|
||||
sdcDisconnect(&SDCD1);
|
||||
}
|
||||
|
||||
status_ = new_status;
|
||||
status_signal.emit(status_);
|
||||
}
|
||||
status_ = new_status;
|
||||
status_signal.emit(status_);
|
||||
}
|
||||
}
|
||||
|
||||
Status status() {
|
||||
return status_;
|
||||
return status_;
|
||||
}
|
||||
|
||||
} /* namespace sd_card */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue