diff --git a/Software/GuitarPedal/Hardware-Modules/base_hardware_module.cpp b/Software/GuitarPedal/Hardware-Modules/base_hardware_module.cpp index a244da1b..c4b40822 100644 --- a/Software/GuitarPedal/Hardware-Modules/base_hardware_module.cpp +++ b/Software/GuitarPedal/Hardware-Modules/base_hardware_module.cpp @@ -1,4 +1,5 @@ #include "base_hardware_module.h" +#include using namespace daisy; using namespace bkshepherd; @@ -203,6 +204,10 @@ void BaseHardwareModule::InitEncoders(int count, Pin pins[][3]) { void BaseHardwareModule::InitLeds(int count, Pin pins[]) { for (int i = 0; i < count; i++) { Led newLed; + // libDaisy's Led::Init() never initialises the software-PWM phase (pwm_), and Led's constructor does nothing, so a stack-allocated + // Led starts with whatever was left on the stack. Depending on the compiler/optimiser that can be a huge or NaN value, which keeps + // the LED permanently off (or on). Zero the whole object first so the PWM phase starts at 0. + std::memset(static_cast(&newLed), 0, sizeof(newLed)); newLed.Init(pins[i], false, AudioCallbackRate()); leds.push_back(newLed); } diff --git a/Software/GuitarPedal/Makefile b/Software/GuitarPedal/Makefile index 078c33a1..8f431e98 100644 --- a/Software/GuitarPedal/Makefile +++ b/Software/GuitarPedal/Makefile @@ -147,24 +147,3 @@ ifdef VARIANT CFLAGS += -DVARIANT_$(VARIANT) $(info VARIANT=$(VARIANT)) endif - - -# --- ARM SDK Version check --- [start] -# Issues have been experienced with the latest version of arm-none-eabi-gcc, so -# we add a check here to help guide users to use a supported version - -# Determine which compiler to check (use GCC_PATH if set, otherwise system default) -GCC_CHECK := arm-none-eabi-gcc -ifdef GCC_PATH - GCC_CHECK := $(GCC_PATH)/arm-none-eabi-gcc -endif - -# Get compiler version string safely -GCC_VERSION := $(shell $(GCC_CHECK) -dumpversion) -GCC_VERSION_MAJOR := $(word 1, $(subst ., ,$(GCC_VERSION))) -GCC_VERSION_MAJOR_REQUIRED := 10 - -ifneq ($(GCC_VERSION_MAJOR),$(GCC_VERSION_MAJOR_REQUIRED)) -$(error Compiler version of arm-none-eabi-gcc: $(GCC_VERSION) is not supported. Use version $(GCC_VERSION_MAJOR_REQUIRED).x.x) -endif -# --- ARM SDK Version check --- [end] \ No newline at end of file diff --git a/Software/GuitarPedal/README.md b/Software/GuitarPedal/README.md index aa780972..767b6d4b 100644 --- a/Software/GuitarPedal/README.md +++ b/Software/GuitarPedal/README.md @@ -12,11 +12,10 @@ Before you can use the software you'll need to do the following steps. There is The code in this project is supplied with a Microsoft Visual Code project and depends on both **LibDaisy** and **DaisySP** from Electro-Smith. Detailed instructions on setting these up for your dev environment can be found here: -https://electro-smith.github.io/libDaisy/index.html +https://docs.daisy.audio/tutorials/cpp-dev-env/ -Some issues have been reported with newer ARM compiler versions. The documentation above from Electrosmith should be complete but for reference many users have had success with `10.3-2021.10` - -Version can be checked with `arm-none-eabi-gcc --version` +Note: previously gcc 10 compiler was enforced by build system, the reasons for this should no longer be valid and the +compiler recommended by daisy.audio should work fine. ### 2. Setup dependencies