summaryrefslogtreecommitdiff
path: root/supervisor/shared
diff options
context:
space:
mode:
authoraskpatricw <4002194+askpatrickw@users.noreply.github.com>2020-12-31 16:54:22 -0800
committeraskpatricw <4002194+askpatrickw@users.noreply.github.com>2020-12-31 16:54:22 -0800
commit9e559ac3ec199890d2ee99eb060743bab3083c46 (patch)
treecc5bf4c3d82a9feac6baa3e83c73e525f928f17f /supervisor/shared
parentf814a34714cfa7d76464cf9a66a1586caa2b423d (diff)
parent5698b8bb0a178d9022cb20de417efa0f77216e87 (diff)
Merge branch 'main' of https://github.com/adafruit/circuitpython into main
Diffstat (limited to 'supervisor/shared')
-rw-r--r--supervisor/shared/external_flash/devices.h18
-rw-r--r--supervisor/shared/tick.c8
-rw-r--r--supervisor/shared/usb/usb_msc_flash.c2
3 files changed, 24 insertions, 4 deletions
diff --git a/supervisor/shared/external_flash/devices.h b/supervisor/shared/external_flash/devices.h
index 6c7d9550f..c8c941adf 100644
--- a/supervisor/shared/external_flash/devices.h
+++ b/supervisor/shared/external_flash/devices.h
@@ -384,6 +384,24 @@ typedef struct {
.write_status_register_split = false, \
}
+// Settings for the Winbond W25Q64FV 8MiB SPI flash.
+// Datasheet: https://www.winbond.com/resource-files/w25q64fv%20revs%2007182017.pdf
+#define W25Q64FV {\
+ .total_size = (1 << 23), /* 8 MiB */ \
+ .start_up_time_us = 5000, \
+ .manufacturer_id = 0xef, \
+ .memory_type = 0x40, \
+ .capacity = 0x17, \
+ .max_clock_speed_mhz = 104, \
+ .quad_enable_bit_mask = 0x02, \
+ .has_sector_protection = false, \
+ .supports_fast_read = true, \
+ .supports_qspi = true, \
+ .supports_qspi_writes = true, \
+ .write_status_register_split = false, \
+ .single_status_byte = false, \
+}
+
// Settings for the Winbond W25Q64JV-IM 8MiB SPI flash. Note that JV-IQ has a different .memory_type (0x40)
// Datasheet: http://www.winbond.com/resource-files/w25q64jv%20revj%2003272018%20plus.pdf
#define W25Q64JV_IM {\
diff --git a/supervisor/shared/tick.c b/supervisor/shared/tick.c
index d37a585eb..e51c48c73 100644
--- a/supervisor/shared/tick.c
+++ b/supervisor/shared/tick.c
@@ -26,6 +26,7 @@
#include "supervisor/shared/tick.h"
+#include "lib/utils/interrupt_char.h"
#include "py/mpstate.h"
#include "py/runtime.h"
#include "supervisor/linker.h"
@@ -145,10 +146,11 @@ void mp_hal_delay_ms(mp_uint_t delay) {
delay = delay * 1024 / 1000;
uint64_t end_tick = start_tick + delay;
int64_t remaining = delay;
- while (remaining > 0) {
+
+ // Loop until we've waited long enough or we've been CTRL-Ced by autoreload
+ // or the user.
+ while (remaining > 0 && !mp_hal_is_interrupted()) {
RUN_BACKGROUND_TASKS;
- // Check to see if we've been CTRL-Ced by autoreload or the user.
- mp_handle_pending();
remaining = end_tick - port_get_raw_ticks(NULL);
// We break a bit early so we don't risk setting the alarm before the time when we call
// sleep.
diff --git a/supervisor/shared/usb/usb_msc_flash.c b/supervisor/shared/usb/usb_msc_flash.c
index b39f60dcd..7532b6aea 100644
--- a/supervisor/shared/usb/usb_msc_flash.c
+++ b/supervisor/shared/usb/usb_msc_flash.c
@@ -39,7 +39,7 @@
#define MSC_FLASH_BLOCK_SIZE 512
-static bool ejected[1] = {false};
+static bool ejected[1] = {true};
void usb_msc_mount(void) {
// Reset the ejection tracking every time we're plugged into USB. This allows for us to battery