Skip to content

Commit 81eed3f

Browse files
Merge branch 'adafruit:main' into seeduino-xiao-rp2040
2 parents 2c3557d + 387a8a4 commit 81eed3f

File tree

110 files changed

+5457
-297
lines changed

Some content is hidden

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

110 files changed

+5457
-297
lines changed

lib/oofatfs/ff.c

Lines changed: 28 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5392,7 +5392,9 @@ FRESULT f_mkfs (
53925392
const UINT n_fats = 1; /* Number of FATs for FAT/FAT32 volume (1 or 2) */
53935393
const UINT n_rootdir = 512; /* Number of root directory entries for FAT volume */
53945394
static const WORD cst[] = {1, 4, 16, 64, 256, 512, 0}; /* Cluster size boundary for FAT volume (4Ks unit) */
5395+
#if FF_MKFS_FAT32
53955396
static const WORD cst32[] = {1, 2, 4, 8, 16, 32, 0}; /* Cluster size boundary for FAT32 volume (128Ks unit) */
5397+
#endif
53965398
BYTE fmt, sys, *buf, *pte, part; void *pdrv;
53975399
WORD ss; /* Sector size */
53985400
DWORD szb_buf, sz_buf, sz_blk, n_clst, pau, sect, nsect, n;
@@ -5464,7 +5466,7 @@ FRESULT f_mkfs (
54645466
}
54655467
}
54665468
if (au > 128) LEAVE_MKFS(FR_INVALID_PARAMETER); /* Too large au for FAT/FAT32 */
5467-
if (opt & FM_FAT32) { /* FAT32 possible? */
5469+
if (FF_MKFS_FAT32 && (opt & FM_FAT32)) { /* FAT32 possible? */
54685470
if ((opt & FM_ANY) == FM_FAT32 || !(opt & FM_FAT)) { /* FAT32 only or no-FAT? */
54695471
fmt = FS_FAT32; break;
54705472
}
@@ -5641,6 +5643,7 @@ FRESULT f_mkfs (
56415643
do {
56425644
pau = au;
56435645
/* Pre-determine number of clusters and FAT sub-type */
5646+
#if FF_MKFS_FAT32
56445647
if (fmt == FS_FAT32) { /* FAT32 volume */
56455648
if (pau == 0) { /* au auto-selection */
56465649
n = sz_vol / 0x20000; /* Volume size in unit of 128KS */
@@ -5651,7 +5654,9 @@ FRESULT f_mkfs (
56515654
sz_rsv = 32; /* Number of reserved sectors */
56525655
sz_dir = 0; /* No static directory */
56535656
if (n_clst <= MAX_FAT16 || n_clst > MAX_FAT32) LEAVE_MKFS(FR_MKFS_ABORTED);
5654-
} else { /* FAT volume */
5657+
} else
5658+
#endif
5659+
{ /* FAT volume */
56555660
if (pau == 0) { /* au auto-selection */
56565661
n = sz_vol / 0x1000; /* Volume size in unit of 4KS */
56575662
for (i = 0, pau = 1; cst[i] && cst[i] <= n; i++, pau <<= 1) ; /* Get from table */
@@ -5681,12 +5686,14 @@ FRESULT f_mkfs (
56815686
/* Determine number of clusters and final check of validity of the FAT sub-type */
56825687
if (sz_vol < b_data + pau * 16 - b_vol) LEAVE_MKFS(FR_MKFS_ABORTED); /* Too small volume */
56835688
n_clst = (sz_vol - sz_rsv - sz_fat * n_fats - sz_dir) / pau;
5689+
#if FF_MKFS_FAT32
56845690
if (fmt == FS_FAT32) {
56855691
if (n_clst <= MAX_FAT16) { /* Too few clusters for FAT32 */
56865692
if (au == 0 && (au = pau / 2) != 0) continue; /* Adjust cluster size and retry */
56875693
LEAVE_MKFS(FR_MKFS_ABORTED);
56885694
}
56895695
}
5696+
#endif
56905697
if (fmt == FS_FAT16) {
56915698
if (n_clst > MAX_FAT16) { /* Too many clusters for FAT16 */
56925699
if (au == 0 && (pau * 2) <= 64) {
@@ -5720,7 +5727,11 @@ FRESULT f_mkfs (
57205727
buf[BPB_SecPerClus] = (BYTE)pau; /* Cluster size [sector] */
57215728
st_word(buf + BPB_RsvdSecCnt, (WORD)sz_rsv); /* Size of reserved area */
57225729
buf[BPB_NumFATs] = (BYTE)n_fats; /* Number of FATs */
5730+
#if FF_MKFS_FAT32
57235731
st_word(buf + BPB_RootEntCnt, (WORD)((fmt == FS_FAT32) ? 0 : n_rootdir)); /* Number of root directory entries */
5732+
#else
5733+
st_word(buf + BPB_RootEntCnt, (WORD) n_rootdir); /* Number of root directory entries */
5734+
#endif
57245735
if (sz_vol < 0x10000) {
57255736
st_word(buf + BPB_TotSec16, (WORD)sz_vol); /* Volume size in 16-bit LBA */
57265737
} else {
@@ -5730,6 +5741,7 @@ FRESULT f_mkfs (
57305741
st_word(buf + BPB_SecPerTrk, 63); /* Number of sectors per track (for int13) */
57315742
st_word(buf + BPB_NumHeads, 255); /* Number of heads (for int13) */
57325743
st_dword(buf + BPB_HiddSec, b_vol); /* Volume offset in the physical drive [sector] */
5744+
#if FF_MKFS_FAT32
57335745
if (fmt == FS_FAT32) {
57345746
st_dword(buf + BS_VolID32, GET_FATTIME()); /* VSN */
57355747
st_dword(buf + BPB_FATSz32, sz_fat); /* FAT size [sector] */
@@ -5739,7 +5751,9 @@ FRESULT f_mkfs (
57395751
buf[BS_DrvNum32] = 0x80; /* Drive number (for int13) */
57405752
buf[BS_BootSig32] = 0x29; /* Extended boot signature */
57415753
mem_cpy(buf + BS_VolLab32, "NO NAME " "FAT32 ", 19); /* Volume label, FAT signature */
5742-
} else {
5754+
} else
5755+
#endif
5756+
{
57435757
st_dword(buf + BS_VolID, GET_FATTIME()); /* VSN */
57445758
st_word(buf + BPB_FATSz16, (WORD)sz_fat); /* FAT size [sector] */
57455759
buf[BS_DrvNum] = 0x80; /* Drive number (for int13) */
@@ -5750,6 +5764,7 @@ FRESULT f_mkfs (
57505764
if (disk_write(pdrv, buf, b_vol, 1) != RES_OK) LEAVE_MKFS(FR_DISK_ERR); /* Write it to the VBR sector */
57515765

57525766
/* Create FSINFO record if needed */
5767+
#if FF_MKFS_FAT32
57535768
if (fmt == FS_FAT32) {
57545769
disk_write(pdrv, buf, b_vol + 6, 1); /* Write backup VBR (VBR + 6) */
57555770
mem_set(buf, 0, ss);
@@ -5761,16 +5776,20 @@ FRESULT f_mkfs (
57615776
disk_write(pdrv, buf, b_vol + 7, 1); /* Write backup FSINFO (VBR + 7) */
57625777
disk_write(pdrv, buf, b_vol + 1, 1); /* Write original FSINFO (VBR + 1) */
57635778
}
5779+
#endif
57645780

57655781
/* Initialize FAT area */
57665782
mem_set(buf, 0, (UINT)szb_buf);
57675783
sect = b_fat; /* FAT start sector */
57685784
for (i = 0; i < n_fats; i++) { /* Initialize FATs each */
5785+
#if FF_MKFS_FAT32
57695786
if (fmt == FS_FAT32) {
57705787
st_dword(buf + 0, 0xFFFFFFF8); /* Entry 0 */
57715788
st_dword(buf + 4, 0xFFFFFFFF); /* Entry 1 */
57725789
st_dword(buf + 8, 0x0FFFFFFF); /* Entry 2 (root directory) */
5773-
} else {
5790+
} else
5791+
#endif
5792+
{
57745793
st_dword(buf + 0, (fmt == FS_FAT12) ? 0xFFFFF8 : 0xFFFFFFF8); /* Entry 0 and 1 */
57755794
}
57765795
nsect = sz_fat; /* Number of FAT sectors */
@@ -5783,7 +5802,11 @@ FRESULT f_mkfs (
57835802
}
57845803

57855804
/* Initialize root directory (fill with zero) */
5805+
#if FF_MKFS_FAT32
57865806
nsect = (fmt == FS_FAT32) ? pau : sz_dir; /* Number of root directory sectors */
5807+
#else
5808+
nsect = sz_dir; /* Number of root directory sectors */
5809+
#endif
57875810
do {
57885811
n = (nsect > sz_buf) ? sz_buf : nsect;
57895812
if (disk_write(pdrv, buf, sect, (UINT)n) != RES_OK) LEAVE_MKFS(FR_DISK_ERR);
@@ -5795,7 +5818,7 @@ FRESULT f_mkfs (
57955818
if (FF_FS_EXFAT && fmt == FS_EXFAT) {
57965819
sys = 0x07; /* HPFS/NTFS/exFAT */
57975820
} else {
5798-
if (fmt == FS_FAT32) {
5821+
if (FF_MKFS_FAT32 && fmt == FS_FAT32) {
57995822
sys = 0x0C; /* FAT32X */
58005823
} else {
58015824
if (sz_vol >= 0x10000) {

lib/oofatfs/ffconf.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,12 @@
7272
#define FF_USE_MKFS 1
7373
/* This option switches f_mkfs() function. (0:Disable or 1:Enable) */
7474

75+
#ifdef MICROPY_FF_MKFS_FAT32
76+
#define FF_MKFS_FAT32 MICROPY_FF_MKFS_FAT32
77+
#else
78+
#define FF_MKFS_FAT32 0
79+
#endif
80+
/* This option switches off FAT32 support in f_mkfs() */
7581

7682
#define FF_USE_FASTSEEK 1
7783
/* This option switches fast seek function. (0:Disable or 1:Enable) */

locale/ID.po

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1301,6 +1301,10 @@ msgstr ""
13011301
msgid "Invalid DAC pin supplied"
13021302
msgstr "Pin DAC yang diberikan tidak valid"
13031303

1304+
#: shared-bindings/wifi/Radio.c
1305+
msgid "Invalid MAC address"
1306+
msgstr ""
1307+
13041308
#: shared-bindings/synthio/__init__.c
13051309
msgid "Invalid MIDI file"
13061310
msgstr ""
@@ -1374,6 +1378,10 @@ msgstr "Ukuran potongan format tidak valid"
13741378
msgid "Invalid memory access."
13751379
msgstr "Akses memori tidak valid."
13761380

1381+
#: ports/espressif/common-hal/wifi/Radio.c
1382+
msgid "Invalid multicast MAC address"
1383+
msgstr ""
1384+
13771385
#: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c
13781386
msgid "Invalid number of bits"
13791387
msgstr "Jumlah bit tidak valid"
@@ -2169,6 +2177,10 @@ msgstr "Memisahkan dengan menggunakan sub-captures"
21692177
msgid "Stack size must be at least 256"
21702178
msgstr "Ukuran stack minimal harus 256"
21712179

2180+
#: ports/espressif/common-hal/wifi/Radio.c
2181+
msgid "Interface must be started"
2182+
msgstr ""
2183+
21722184
#: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c
21732185
msgid "Stereo left must be on PWM channel A"
21742186
msgstr ""
@@ -3962,7 +3974,7 @@ msgid "pow() with 3 arguments requires integers"
39623974
msgstr ""
39633975

39643976
#: ports/espressif/boards/adafruit_feather_esp32s2/mpconfigboard.h
3965-
#: ports/espressif/boards/adafruit_feather_esp32s2_nopsram/mpconfigboard.h
3977+
#: ports/espressif/boards/adafruit_feather_esp32s2_tft/mpconfigboard.h
39663978
#: ports/espressif/boards/adafruit_feather_esp32s2_tftback_nopsram/mpconfigboard.h
39673979
#: ports/espressif/boards/adafruit_funhouse/mpconfigboard.h
39683980
#: ports/espressif/boards/adafruit_magtag_2.9_grayscale/mpconfigboard.h
@@ -4180,6 +4192,10 @@ msgstr ""
41804192
msgid "source_bitmap must have value_count of 8"
41814193
msgstr ""
41824194

4195+
#: shared-bindings/wifi/Radio.c
4196+
msgid "ssid can't be more than 32 bytes"
4197+
msgstr ""
4198+
41834199
#: py/objstr.c
41844200
msgid "start/end indices"
41854201
msgstr ""

locale/circuitpython.pot

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1280,6 +1280,10 @@ msgstr ""
12801280
msgid "Invalid DAC pin supplied"
12811281
msgstr ""
12821282

1283+
#: shared-bindings/wifi/Radio.c
1284+
msgid "Invalid MAC address"
1285+
msgstr ""
1286+
12831287
#: shared-bindings/synthio/__init__.c
12841288
msgid "Invalid MIDI file"
12851289
msgstr ""
@@ -1353,6 +1357,10 @@ msgstr ""
13531357
msgid "Invalid memory access."
13541358
msgstr ""
13551359

1360+
#: ports/espressif/common-hal/wifi/Radio.c
1361+
msgid "Invalid multicast MAC address"
1362+
msgstr ""
1363+
13561364
#: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c
13571365
msgid "Invalid number of bits"
13581366
msgstr ""
@@ -2134,6 +2142,10 @@ msgstr ""
21342142
msgid "Stack size must be at least 256"
21352143
msgstr ""
21362144

2145+
#: ports/espressif/common-hal/wifi/Radio.c
2146+
msgid "Interface must be started"
2147+
msgstr ""
2148+
21372149
#: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c
21382150
msgid "Stereo left must be on PWM channel A"
21392151
msgstr ""
@@ -3924,7 +3936,7 @@ msgid "pow() with 3 arguments requires integers"
39243936
msgstr ""
39253937

39263938
#: ports/espressif/boards/adafruit_feather_esp32s2/mpconfigboard.h
3927-
#: ports/espressif/boards/adafruit_feather_esp32s2_nopsram/mpconfigboard.h
3939+
#: ports/espressif/boards/adafruit_feather_esp32s2_tft/mpconfigboard.h
39283940
#: ports/espressif/boards/adafruit_feather_esp32s2_tftback_nopsram/mpconfigboard.h
39293941
#: ports/espressif/boards/adafruit_funhouse/mpconfigboard.h
39303942
#: ports/espressif/boards/adafruit_magtag_2.9_grayscale/mpconfigboard.h
@@ -4142,6 +4154,10 @@ msgstr ""
41424154
msgid "source_bitmap must have value_count of 8"
41434155
msgstr ""
41444156

4157+
#: shared-bindings/wifi/Radio.c
4158+
msgid "ssid can't be more than 32 bytes"
4159+
msgstr ""
4160+
41454161
#: py/objstr.c
41464162
msgid "start/end indices"
41474163
msgstr ""

0 commit comments

Comments
 (0)