diff --git a/CMakeLists.txt b/CMakeLists.txt index efa2610..07932d2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 3.13) set(CMAKE_C_STANDARD 11) -set(CMAKE_CXX_STANDARD 20) +set(CMAKE_CXX_STANDARD 23) # Initialise pico_sdk from installed location # (note this can come from environment, CMake cache etc) diff --git a/src/ws2812.cpp b/src/ws2812.cpp index edf35b7..d21074b 100644 --- a/src/ws2812.cpp +++ b/src/ws2812.cpp @@ -1,10 +1,12 @@ #include "ws2812.h" +#include + WS2812::WS2812(uint gpio, PIO pio, uint sm) : m_pio{pio}, m_gpio{gpio}, m_sm{sm} { init(); } WS2812::~WS2812() { deinit(); } -void WS2812::switchColor(Color color) { putPixel(static_cast(color)); } +void WS2812::switchColor(Color color) { putPixel(std::to_underlying(color)); } void WS2812::blinkReady() { for (int i = 0; i < 2; i++) {