Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions atmel-samd/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ INC += -I. \
-Iasf4/$(CHIP_FAMILY)/usb \
-Iasf4/$(CHIP_FAMILY)/usb/class/cdc \
-Iasf4/$(CHIP_FAMILY)/usb/class/hid \
-Iasf4/$(CHIP_FAMILY)/usb/class/msc \
-Iasf4/$(CHIP_FAMILY)/usb/device \
-Iasf4_conf/$(CHIP_FAMILY) \
-Iboards/$(BOARD) \
Expand Down Expand Up @@ -181,6 +182,7 @@ SRC_ASF := \
hpl/tc/hpl_tc.c \
hpl/usb/hpl_usb.c \
usb/class/cdc/device/cdcdf_acm.c \
usb/class/msc/device/mscdf.c \
usb/device/usbdc.c \
usb/usb_protocol.c \
hal/utils/src/utils_list.c \
Expand All @@ -204,8 +206,7 @@ endif
SRC_ASF := $(addprefix asf4/$(CHIP_FAMILY)/, $(SRC_ASF))

# Skip this source for now.
# access_vfs.c \
shared_dma.c \
# shared_dma.c \

SRC_C = \
background.c \
Expand All @@ -216,6 +217,7 @@ SRC_C = \
$(CHIP_FAMILY)_pins.c \
tick.c \
usb.c \
usb_mass_storage.c \
$(FLASH_IMPL) \
bindings/samd/__init__.c \
boards/$(BOARD)/board.c \
Expand Down
191 changes: 0 additions & 191 deletions atmel-samd/access_vfs.c

This file was deleted.

8 changes: 4 additions & 4 deletions atmel-samd/asf4_conf/samd21/hpl_usb_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
// <CONF_USB_D_N_EP_MAX"> Max possible (by "Max Endpoint Number" config)
// <id> usbd_num_ep_sp
#ifndef CONF_USB_D_NUM_EP_SP
#define CONF_USB_D_NUM_EP_SP CONF_USB_N_4
#define CONF_USB_D_NUM_EP_SP CONF_USB_D_EP_N_MAX
#endif

// </h>
Expand All @@ -60,7 +60,7 @@
// <i> The number of physical endpoints - 1
// <id> usbd_arch_max_ep_n
#ifndef CONF_USB_D_MAX_EP_N
#define CONF_USB_D_MAX_EP_N CONF_USB_N_2
#define CONF_USB_D_MAX_EP_N CONF_USB_D_EP_N_MAX
#endif

// <y> USB Speed Limit
Expand Down Expand Up @@ -156,7 +156,7 @@
// <1024=> Cached by 1024 bytes buffer (interrupt or isochronous EP)
// <id> usb_ep2_I_CACHE
#ifndef CONF_USB_EP2_I_CACHE
#define CONF_USB_EP2_I_CACHE 0
#define CONF_USB_EP2_I_CACHE 64
#endif
// </h>

Expand Down Expand Up @@ -308,7 +308,7 @@
// <1024=> Cached by 1024 bytes buffer (interrupt or isochronous EP)
// <id> usb_ep6_I_CACHE
#ifndef CONF_USB_EP6_I_CACHE
#define CONF_USB_EP6_I_CACHE 0
#define CONF_USB_EP6_I_CACHE 64
#endif
// </h>

Expand Down
8 changes: 5 additions & 3 deletions atmel-samd/asf4_conf/samd51/hpl_usb_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@

// <y> Max number of endpoints supported
// <i> Limits the number of endpoints (described by EP address) can be used in app.
// NOTE(tannewt): This not only limits the number of endpoints but also the
// addresses. In other words, even if you use endpoint 6 you need to set this to 11.
// <CONF_USB_N_1"> 1 (EP0 only)
// <CONF_USB_N_2"> 2 (EP0 + 1 endpoint)
// <CONF_USB_N_3"> 3 (EP0 + 2 endpoints)
Expand All @@ -39,7 +41,7 @@
// <CONF_USB_D_N_EP_MAX"> Max possible (by "Max Endpoint Number" config)
// <id> usbd_num_ep_sp
#ifndef CONF_USB_D_NUM_EP_SP
#define CONF_USB_D_NUM_EP_SP CONF_USB_N_4
#define CONF_USB_D_NUM_EP_SP CONF_USB_D_N_EP_MAX
#endif

// </h>
Expand All @@ -60,7 +62,7 @@
// <i> The number of physical endpoints - 1
// <id> usbd_arch_max_ep_n
#ifndef CONF_USB_D_MAX_EP_N
#define CONF_USB_D_MAX_EP_N CONF_USB_N_2
#define CONF_USB_D_MAX_EP_N CONF_USB_D_EP_N_MAX
#endif

// <y> USB Speed Limit
Expand Down Expand Up @@ -308,7 +310,7 @@
// <1024=> Cached by 1024 bytes buffer (interrupt or isochronous EP)
// <id> usb_ep6_I_CACHE
#ifndef CONF_USB_EP6_I_CACHE
#define CONF_USB_EP6_I_CACHE 0
#define CONF_USB_EP6_I_CACHE 64
#endif
// </h>

Expand Down
3 changes: 2 additions & 1 deletion atmel-samd/background.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,9 @@
#include "background.h"

// #include "common-hal/audioio/AudioOut.h"
#include "usb_mass_storage.h"

void run_background_tasks(void) {
// audioout_background();
// udi_msc_process_trans();
usb_msc_background();
}
4 changes: 0 additions & 4 deletions atmel-samd/internal_flash.c
Original file line number Diff line number Diff line change
Expand Up @@ -172,17 +172,13 @@ bool internal_flash_write_block(const uint8_t *src, uint32_t block) {
return false;
}
int32_t error_code;
// A block is formed by two rows of flash. We must erase each row
// before we write back to it.
error_code = flash_erase(&internal_flash_desc,
dest,
FILESYSTEM_BLOCK_SIZE / flash_get_page_size(&internal_flash_desc));
if (error_code != ERR_NONE) {
return false;
}

// A block is made up of multiple pages. Write each page
// sequentially.
error_code = flash_append(&internal_flash_desc, dest, src, FILESYSTEM_BLOCK_SIZE);
if (error_code != ERR_NONE) {
return false;
Expand Down
4 changes: 4 additions & 0 deletions atmel-samd/mpconfigport.h
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,10 @@ typedef long mp_off_t;
#include "mpconfigboard.h"
#include "include/sam.h"

// ASF4 defines.
#define CONF_USB_COMPOSITE_CDC_ACM_EN 1
#define CONF_USB_COMPOSITE_MSC_EN 1

#ifdef SAMD21
#define CIRCUITPY_MCU_FAMILY samd21
#define MICROPY_PY_SYS_PLATFORM "Atmel SAMD21"
Expand Down
1 change: 1 addition & 0 deletions atmel-samd/supervisor/filesystem.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ void filesystem_init(bool create_allowed) {

// set label
f_setlabel(&vfs_fat->fatfs, "CIRCUITPY");
flash_flush();
} else if (res != FR_OK) {
return;
}
Expand Down
Loading