Skip to content

Commit fe41fcd

Browse files
committed
modified SAMD21 PWM to use Arduino functions
1 parent 06a2e8e commit fe41fcd

5 files changed

Lines changed: 544 additions & 146 deletions

File tree

boards/zeroUSB_au.json

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
{
2+
"build": {
3+
"arduino": {
4+
"ldscript": "flash_with_bootloader.ld"
5+
},
6+
"core": "arduino",
7+
"cpu": "cortex-m0plus",
8+
"extra_flags": "-DARDUINO_SAMD_ZERO -D__SAMD21G18AU__",
9+
"f_cpu": "48000000L",
10+
"hwids": [
11+
[
12+
"0x2341",
13+
"0x804D"
14+
],
15+
[
16+
"0x2341",
17+
"0x004D"
18+
],
19+
[
20+
"0x2341",
21+
"0x824D"
22+
]
23+
],
24+
"mcu": "samd21g18au",
25+
"usb_product": "Arduino Zero",
26+
"variant": "arduino_zero"
27+
},
28+
"debug": {
29+
"jlink_device": "ATSAMD21G18",
30+
"onboard_tools": [
31+
"cmsis-dap"
32+
],
33+
"openocd_chipname": "at91samd21g18",
34+
"openocd_target": "at91samdXX",
35+
"svd_path": "ATSAMD21G18A.svd"
36+
},
37+
"frameworks": [
38+
"arduino"
39+
],
40+
"name": "Arduino Zero (USB Native Port)",
41+
"upload": {
42+
"disable_flushing": true,
43+
"maximum_ram_size": 32768,
44+
"maximum_size": 262144,
45+
"native_usb": true,
46+
"offset_address": "0x2000",
47+
"protocol": "sam-ba",
48+
"protocols": [
49+
"sam-ba",
50+
"blackmagic",
51+
"jlink",
52+
"atmel-ice"
53+
],
54+
"require_upload_port": true,
55+
"use_1200bps_touch": true,
56+
"wait_for_upload_port": true
57+
},
58+
"url": "https://www.arduino.cc/en/Main/ArduinoBoardZero",
59+
"vendor": "Arduino"
60+
}

docs/mcumap_gen.xlsx

1.84 KB
Binary file not shown.

uCNC/src/hal/boards/samd21/samd21.ini

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44

55
[common_samd21]
66
platform = atmelsam
7-
; platform_packages = platformio/toolchain-gccarmnoneeabi
8-
board = zeroUSB
97
build_flags = ${env.build_flags} -std=gnu99 -Wall -fdata-sections -ffunction-sections -fno-exceptions -Wl,--gc-sections -nostdlib -fno-exceptions
108
lib_deps =
119
${env.lib_deps}
@@ -31,13 +29,15 @@ debug_init_cmds =
3129

3230
[env:SAMD21-Wemos-M0]
3331
extends = common_samd21
32+
board = zeroUSB_au
3433
build_flags = ${common_samd21.build_flags} -D BOARDMAP=\"src/hal/boards/samd21/boardmap_mzero.h\"
3534
board_build.offset = 0x2000
3635
board_upload.offset_address = 0x00002000
3736

3837

3938
[env:SAMD21-Arduino-Zero]
4039
extends = common_samd21
40+
board = zeroUSB
4141
build_flags = ${common_samd21.build_flags} -D BOARDMAP=\"src/hal/boards/samd21/boardmap_zero.h\"
4242
board_build.offset = 0x4000
4343
board_upload.offset_address = 0x00004000

uCNC/src/hal/mcus/samd21/mcu_samd21.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ void EIC_Handler(void)
192192
#endif
193193

194194
#ifdef ARDUINO
195-
uint32_t findPin(EPortType port, uint32_t pin)
195+
int findPin(EPortType port, int pin)
196196
{
197197
for (unsigned int i = 0; i < PINCOUNT_fn(); i++)
198198
{

0 commit comments

Comments
 (0)