simplify code

This commit is contained in:
Martin Brodbeck 2024-03-06 13:00:09 +01:00
parent 0139611ea2
commit aa05bb558d
2 changed files with 3 additions and 3 deletions

View file

@ -3,7 +3,7 @@
cmake_minimum_required(VERSION 3.26) cmake_minimum_required(VERSION 3.26)
set(CMAKE_C_STANDARD 11) set(CMAKE_C_STANDARD 11)
set(CMAKE_CXX_STANDARD 20) set(CMAKE_CXX_STANDARD 23)
# Initialise pico_sdk from installed location # Initialise pico_sdk from installed location
# (note this can come from environment, CMake cache etc) # (note this can come from environment, CMake cache etc)

View file

@ -1,7 +1,7 @@
#include <cmath> #include <cmath>
#include <stdio.h> #include <stdio.h>
#include <type_traits> #include <utility>
#include "bsp/board.h" #include "bsp/board.h"
#include "hardware/adc.h" #include "hardware/adc.h"
@ -141,7 +141,7 @@ int main()
auto timestamp = get_absolute_time(); auto timestamp = get_absolute_time();
auto ignoreButtonKeyerModeUntil = timestamp; auto ignoreButtonKeyerModeUntil = timestamp;
uint count = static_cast<std::underlying_type<Mode>::type>(settings.mode); // TODO: Simplify with C++23 auto count = std::to_underlying(settings.mode);
while (true) { while (true) {
timestamp = get_absolute_time(); timestamp = get_absolute_time();