Skip to content

Commit 5f3ef9f

Browse files
authored
Merge pull request #31 from adafruit/main
Update from adafruit/main
2 parents f362a4a + 579e508 commit 5f3ef9f

File tree

152 files changed

+3668
-1495
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

152 files changed

+3668
-1495
lines changed

.github/workflows/build.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
- name: CircuitPython version
2929
run: |
3030
git describe --dirty --tags
31-
echo "::set-env name=CP_VERSION::$(git describe --dirty --tags)"
31+
echo >>$GITHUB_ENV CP_VERSION=$(git describe --dirty --tags)
3232
- name: Set up Python 3.8
3333
uses: actions/setup-python@v1
3434
with:
@@ -132,7 +132,7 @@ jobs:
132132
- name: Install dependencies
133133
run: |
134134
brew install gettext awscli
135-
echo "::set-env name=PATH::/usr/local/opt/gettext/bin:$PATH"
135+
echo >>$GITHUB_PATH /usr/local/opt/gettext/bin
136136
- name: Versions
137137
run: |
138138
gcc --version
@@ -146,7 +146,7 @@ jobs:
146146
- name: CircuitPython version
147147
run: |
148148
git describe --dirty --tags
149-
echo "::set-env name=CP_VERSION::$(git describe --dirty --tags)"
149+
echo >>$GITHUB_ENV CP_VERSION=$(git describe --dirty --tags)
150150
- name: Build mpy-cross
151151
run: make -C mpy-cross -j2
152152
- uses: actions/upload-artifact@v2
@@ -180,6 +180,7 @@ jobs:
180180
- "arduino_zero"
181181
- "bast_pro_mini_m0"
182182
- "bdmicro_vina_d21"
183+
- "bdmicro_vina_d51"
183184
- "bless_dev_board_multi_sensor"
184185
- "blm_badge"
185186
- "capablerobot_usbhub"
@@ -243,6 +244,7 @@ jobs:
243244
- "metro_m0_express"
244245
- "metro_m4_airlift_lite"
245246
- "metro_m4_express"
247+
- "metro_m7_1011"
246248
- "metro_nrf52840_express"
247249
- "mini_sam_m4"
248250
- "monster_m4sk"

.github/workflows/pre-commit.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
- uses: actions/checkout@v1
1717
- uses: actions/setup-python@v1
1818
- name: set PY
19-
run: echo "::set-env name=PY::$(python -c 'import hashlib, sys;print(hashlib.sha256(sys.version.encode()+sys.executable.encode()).hexdigest())')"
19+
run: echo >>$GITHUB_ENV PY="$(python -c 'import hashlib, sys;print(hashlib.sha256(sys.version.encode()+sys.executable.encode()).hexdigest())')"
2020
- uses: actions/cache@v1
2121
with:
2222
path: ~/.cache/pre-commit

.gitmodules

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -144,12 +144,12 @@
144144
[submodule "frozen/Adafruit_CircuitPython_BLE_Apple_Notification_Center"]
145145
path = frozen/Adafruit_CircuitPython_BLE_Apple_Notification_Center
146146
url = https://github.com/adafruit/Adafruit_CircuitPython_BLE_Apple_Notification_Center
147-
[submodule "ports/esp32s2/esp-idf"]
148-
path = ports/esp32s2/esp-idf
149-
url = https://github.com/tannewt/esp-idf.git
150147
[submodule "frozen/Adafruit_CircuitPython_RFM9x"]
151148
path = frozen/Adafruit_CircuitPython_RFM9x
152149
url = https://github.com/adafruit/Adafruit_CircuitPython_RFM9x.git
153150
[submodule "frozen/Adafruit_CircuitPython_RFM69"]
154151
path = frozen/Adafruit_CircuitPython_RFM69
155152
url = https://github.com/adafruit/Adafruit_CircuitPython_RFM69.git
153+
[submodule "ports/esp32s2/esp-idf"]
154+
path = ports/esp32s2/esp-idf
155+
url = https://github.com/espressif/esp-idf.git

devices/ble_hci/common-hal/_bleio/__init__.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ bleio_adapter_obj_t *common_hal_bleio_allocate_adapter_or_raise(void) {
9898

9999
void common_hal_bleio_check_connected(uint16_t conn_handle) {
100100
if (conn_handle == BLE_CONN_HANDLE_INVALID) {
101-
mp_raise_bleio_ConnectionError(translate("Not connected"));
101+
mp_raise_ConnectionError(translate("Not connected"));
102102
}
103103
}
104104

extmod/vfs_fat_diskio.c

Lines changed: 25 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ DRESULT disk_write (
123123

124124
DRESULT disk_ioctl (
125125
bdev_t pdrv, /* Physical drive nmuber (0..) */
126-
BYTE cmd, /* Control code */
126+
BYTE cmd, /* Control code */
127127
void *buff /* Buffer to send/receive control data */
128128
)
129129
{
@@ -133,7 +133,7 @@ DRESULT disk_ioctl (
133133
}
134134

135135
// First part: call the relevant method of the underlying block device
136-
mp_obj_t ret = mp_const_none;
136+
mp_int_t out_value = 0;
137137
if (vfs->flags & FSUSER_HAVE_IOCTL) {
138138
// new protocol with ioctl
139139
static const uint8_t op_map[8] = {
@@ -144,9 +144,19 @@ DRESULT disk_ioctl (
144144
};
145145
uint8_t bp_op = op_map[cmd & 7];
146146
if (bp_op != 0) {
147-
vfs->u.ioctl[2] = MP_OBJ_NEW_SMALL_INT(bp_op);
148-
vfs->u.ioctl[3] = MP_OBJ_NEW_SMALL_INT(0); // unused
149-
ret = mp_call_method_n_kw(2, 0, vfs->u.ioctl);
147+
if (vfs->flags & FSUSER_NATIVE) {
148+
bool (*f)(size_t, mp_int_t*) = (void*)(uintptr_t)vfs->u.ioctl[2];
149+
if (!f(bp_op, (mp_int_t*) &out_value)) {
150+
return RES_ERROR;
151+
}
152+
} else {
153+
vfs->u.ioctl[2] = MP_OBJ_NEW_SMALL_INT(bp_op);
154+
vfs->u.ioctl[3] = MP_OBJ_NEW_SMALL_INT(0); // unused
155+
mp_obj_t ret = mp_call_method_n_kw(2, 0, vfs->u.ioctl);
156+
if (ret != mp_const_none) {
157+
out_value = mp_obj_get_int(ret);
158+
}
159+
}
150160
}
151161
} else {
152162
// old protocol with sync and count
@@ -157,10 +167,13 @@ DRESULT disk_ioctl (
157167
}
158168
break;
159169

160-
case GET_SECTOR_COUNT:
161-
ret = mp_call_method_n_kw(0, 0, vfs->u.old.count);
170+
case GET_SECTOR_COUNT: {
171+
mp_obj_t ret = mp_call_method_n_kw(0, 0, vfs->u.old.count);
172+
if (ret != mp_const_none) {
173+
out_value = mp_obj_get_int(ret);
174+
}
162175
break;
163-
176+
}
164177
case GET_SECTOR_SIZE:
165178
// old protocol has fixed sector size of 512 bytes
166179
break;
@@ -177,16 +190,16 @@ DRESULT disk_ioctl (
177190
return RES_OK;
178191

179192
case GET_SECTOR_COUNT: {
180-
*((DWORD*)buff) = mp_obj_get_int(ret);
193+
*((DWORD*)buff) = out_value;
181194
return RES_OK;
182195
}
183196

184197
case GET_SECTOR_SIZE: {
185-
if (ret == mp_const_none) {
198+
if (out_value == 0) {
186199
// Default sector size
187200
*((WORD*)buff) = 512;
188201
} else {
189-
*((WORD*)buff) = mp_obj_get_int(ret);
202+
*((WORD*)buff) = out_value;
190203
}
191204
#if _MAX_SS != _MIN_SS
192205
// need to store ssize because we use it in disk_read/disk_write
@@ -202,7 +215,7 @@ DRESULT disk_ioctl (
202215
case IOCTL_INIT:
203216
case IOCTL_STATUS: {
204217
DSTATUS stat;
205-
if (ret != mp_const_none && MP_OBJ_SMALL_INT_VALUE(ret) != 0) {
218+
if (out_value != 0) {
206219
// error initialising
207220
stat = STA_NOINIT;
208221
} else if (vfs->writeblocks[0] == MP_OBJ_NULL) {

0 commit comments

Comments
 (0)