From 4224d0a243adabf197b29f1eb66bcdf576538e5f Mon Sep 17 00:00:00 2001 From: Thomas Friedrichsmeier Date: Tue, 11 Apr 2023 10:39:50 +0200 Subject: [PATCH 1/4] Add SAMD auto-builds Use define for output resolution --- .github/workflows/compile_examples.yml | 4 ++++ MozziGuts_impl_SAMD.hpp | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/compile_examples.yml b/.github/workflows/compile_examples.yml index 9708bbf5f..950ddd703 100644 --- a/.github/workflows/compile_examples.yml +++ b/.github/workflows/compile_examples.yml @@ -41,6 +41,10 @@ jobs: platforms: | - name: esp8266:esp8266 source-url: https://arduino.esp8266.com/stable/package_esp8266com_index.json + # SAMD boards. There is also an Adrafruit fork of this core, and the two seem to have diverged, considerably. I have no idea on the differences. + - fqbn: arduino:samd:arduino_mzero + platforms: | + - name: arduino:samd steps: - name: Checkout repository diff --git a/MozziGuts_impl_SAMD.hpp b/MozziGuts_impl_SAMD.hpp index a8f1be715..03cc61910 100644 --- a/MozziGuts_impl_SAMD.hpp +++ b/MozziGuts_impl_SAMD.hpp @@ -123,7 +123,7 @@ static void startAudio() { } #endif - analogWriteResolution(10); + analogWriteResolution(AUDIO_BITS); #if (EXTERNAL_AUDIO_OUTPUT != true) analogWrite(AUDIO_CHANNEL_1_PIN, 0); #endif From b449c21dc5fa00cbeab71f98fe87aa4b96b8cab1 Mon Sep 17 00:00:00 2001 From: Thomas Friedrichsmeier Date: Tue, 11 Apr 2023 10:54:42 +0200 Subject: [PATCH 2/4] Add documentation for SAMD port @adrianfreed please take a quick look, if you are still around --- .github/workflows/compile_examples.yml | 2 +- README.md | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/compile_examples.yml b/.github/workflows/compile_examples.yml index 950ddd703..569ace63c 100644 --- a/.github/workflows/compile_examples.yml +++ b/.github/workflows/compile_examples.yml @@ -42,7 +42,7 @@ jobs: - name: esp8266:esp8266 source-url: https://arduino.esp8266.com/stable/package_esp8266com_index.json # SAMD boards. There is also an Adrafruit fork of this core, and the two seem to have diverged, considerably. I have no idea on the differences. - - fqbn: arduino:samd:arduino_mzero + - fqbn: arduino:samd:mkrzero platforms: | - name: arduino:samd diff --git a/README.md b/README.md index d55bb3df3..6ef3c5e7c 100644 --- a/README.md +++ b/README.md @@ -230,6 +230,13 @@ Some of the differences for Teensy 4.*: - Contrary to the Teensy 3, the Teensy 4 do not have any DAC. The output is done on pin A8 (PWM) by default (editable in `AudioConfigTeensy4.h` +### SAMD21 architecture (Arduino Circuitplayground M0 and others) +port by Adrian Freed + +- Output using inbuilt DAC (pin DAC0). Ouput resolution is fixed at 10 bits. If your board supports more, configure in AudioConfigSAMD21.h +- mozziAnalogRead() and AUDIO_INPUT are not implemented (contributions welcome) +- We don't have a lot of data, which boards this port has been tested on. Success or not, let us know, if you are using Mozzi on SAMD21 boards + ### ESP8266 port by Thomas Friedrichsmeier From e1dd2265e3f8f4e9d183528fcb07be4708d43e26 Mon Sep 17 00:00:00 2001 From: Thomas Friedrichsmeier Date: Tue, 11 Apr 2023 11:31:17 +0200 Subject: [PATCH 3/4] Built on a board with a DAC --- .github/workflows/compile_examples.yml | 2 +- README.md | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/compile_examples.yml b/.github/workflows/compile_examples.yml index 569ace63c..2ffc55c84 100644 --- a/.github/workflows/compile_examples.yml +++ b/.github/workflows/compile_examples.yml @@ -42,7 +42,7 @@ jobs: - name: esp8266:esp8266 source-url: https://arduino.esp8266.com/stable/package_esp8266com_index.json # SAMD boards. There is also an Adrafruit fork of this core, and the two seem to have diverged, considerably. I have no idea on the differences. - - fqbn: arduino:samd:mkrzero + - fqbn: arduino:samd:circuitplay platforms: | - name: arduino:samd diff --git a/README.md b/README.md index 6ef3c5e7c..3f1baafeb 100644 --- a/README.md +++ b/README.md @@ -233,7 +233,8 @@ Some of the differences for Teensy 4.*: ### SAMD21 architecture (Arduino Circuitplayground M0 and others) port by Adrian Freed -- Output using inbuilt DAC (pin DAC0). Ouput resolution is fixed at 10 bits. If your board supports more, configure in AudioConfigSAMD21.h +- Currently, only output on the inbuilt DAC (pin DAC0) is supported. So, obviously, boards without a DAC are not yet convered (in theory you can still use EXTERNAL_AUDIO_OUTPUT) +- Output resolution is fixed at 10 bits. If your board supports more, configure in AudioConfigSAMD21.h - mozziAnalogRead() and AUDIO_INPUT are not implemented (contributions welcome) - We don't have a lot of data, which boards this port has been tested on. Success or not, let us know, if you are using Mozzi on SAMD21 boards From 982e7a3494bdd76bfa328aa361af042110f872c7 Mon Sep 17 00:00:00 2001 From: Thomas Friedrichsmeier Date: Tue, 11 Apr 2023 11:36:43 +0200 Subject: [PATCH 4/4] Fix board id --- .github/workflows/compile_examples.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/compile_examples.yml b/.github/workflows/compile_examples.yml index 2ffc55c84..01bb094ce 100644 --- a/.github/workflows/compile_examples.yml +++ b/.github/workflows/compile_examples.yml @@ -42,7 +42,7 @@ jobs: - name: esp8266:esp8266 source-url: https://arduino.esp8266.com/stable/package_esp8266com_index.json # SAMD boards. There is also an Adrafruit fork of this core, and the two seem to have diverged, considerably. I have no idea on the differences. - - fqbn: arduino:samd:circuitplay + - fqbn: arduino:samd:adafruit_circuitplayground_m0 platforms: | - name: arduino:samd