From e9fef4f4d3a2ca4cfc0477d1421c42a2db66338b Mon Sep 17 00:00:00 2001 From: Martin Brodbeck Date: Thu, 12 Jan 2023 08:49:02 +0100 Subject: [PATCH] using new language feature --- CMakeLists.txt | 2 +- src/ws2812.cpp | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) 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++) {