summaryrefslogtreecommitdiff
path: root/src/drivers
diff options
context:
space:
mode:
authorjacqueline <me@jacqueline.id.au>2024-04-08 13:50:35 +1000
committerjacqueline <me@jacqueline.id.au>2024-04-08 13:50:35 +1000
commit5f1a6507d8f7a0f9ecea179f94aeb182eac77cfe (patch)
tree42220c19c5511902ef032ec0453a5d3b5cc2d39c /src/drivers
parent251c0ba96dadf8d28406095ec2189466b631f7f8 (diff)
downloadtangara-fw-5f1a6507d8f7a0f9ecea179f94aeb182eac77cfe.tar.gz
Warn and block MSC disable if the sd card is busy
Diffstat (limited to 'src/drivers')
-rw-r--r--src/drivers/include/samd.hpp4
-rw-r--r--src/drivers/samd.cpp2
2 files changed, 3 insertions, 3 deletions
diff --git a/src/drivers/include/samd.hpp b/src/drivers/include/samd.hpp
index ac265950..55ea513c 100644
--- a/src/drivers/include/samd.hpp
+++ b/src/drivers/include/samd.hpp
@@ -48,8 +48,8 @@ class Samd {
// There is a compatible usb host attached, but USB MSC is not currently
// in use by the SAMD.
kAttachedIdle,
- // The SAMD is currently exposing the SD card via USB MSC.
- kAttachedMounted,
+ // The SAMD is currently writing to the SD card via USB MSC.
+ kAttachedBusy,
};
auto GetUsbStatus() -> UsbStatus;
diff --git a/src/drivers/samd.cpp b/src/drivers/samd.cpp
index b631b4fb..e47d9cfe 100644
--- a/src/drivers/samd.cpp
+++ b/src/drivers/samd.cpp
@@ -113,7 +113,7 @@ auto Samd::UpdateUsbStatus() -> void {
usb_status_ = UsbStatus::kDetached;
}
usb_status_ =
- (raw_res & 0b10) ? UsbStatus::kAttachedMounted : UsbStatus::kAttachedIdle;
+ (raw_res & 0b10) ? UsbStatus::kAttachedBusy : UsbStatus::kAttachedIdle;
}
auto Samd::ResetToFlashSamd() -> void {