From 1c5227a202261d5d7e87e29731ae5c8473bfd732 Mon Sep 17 00:00:00 2001 From: Khalil Estell Date: Sun, 6 Aug 2023 06:31:44 -0700 Subject: [PATCH] :arrow_up: Support libhal-util/^3.0.0 --- conanfile.py | 5 ++--- include/libhal-armcortex/system_control.hpp | 4 ++++ src/systick_timer.cpp | 8 ++++---- src/systick_timer_reg.hpp | 10 +++++----- 4 files changed, 15 insertions(+), 12 deletions(-) diff --git a/conanfile.py b/conanfile.py index 93809d9..939ac4b 100644 --- a/conanfile.py +++ b/conanfile.py @@ -18,7 +18,6 @@ from conan.tools.cmake import CMake, cmake_layout from conan.tools.files import copy from conan.tools.build import check_min_cppstd -from conan.errors import ConanInvalidConfiguration import os @@ -27,7 +26,7 @@ class libhal_arm_cortex_conan(ConanFile): name = "libhal-armcortex" - version = "2.0.2" + version = "2.0.3" license = "Apache-2.0" url = "https://github.com/conan-io/conan-center-index" homepage = "https://libhal.github.io/libhal-armcortex" @@ -68,7 +67,7 @@ def build_requirements(self): def requirements(self): self.requires("libhal/[^2.0.0]") - self.requires("libhal-util/[^2.0.0]") + self.requires("libhal-util/[^3.0.0]") def layout(self): cmake_layout(self) diff --git a/include/libhal-armcortex/system_control.hpp b/include/libhal-armcortex/system_control.hpp index f8138cb..340ecf3 100644 --- a/include/libhal-armcortex/system_control.hpp +++ b/include/libhal-armcortex/system_control.hpp @@ -14,6 +14,10 @@ #pragma once +/** + * @brief libhal drivers for the ARM Cortex-M series of processors + * + */ namespace hal::cortex_m { /** * @brief Enable the floating point unit coprocessor diff --git a/src/systick_timer.cpp b/src/systick_timer.cpp index 6140f6d..a86ab7f 100644 --- a/src/systick_timer.cpp +++ b/src/systick_timer.cpp @@ -28,13 +28,13 @@ namespace hal::cortex_m { void start() { - hal::bit::modify(sys_tick->control) + hal::bit_modify(sys_tick->control) .set(); } void stop() { - hal::bit::modify(sys_tick->control) + hal::bit_modify(sys_tick->control) .clear(); } @@ -55,7 +55,7 @@ void systick_timer::register_cpu_frequency(hertz p_frequency, // reloading of the register and will stop the timer. sys_tick->current_value = 0; - auto control = hal::bit::value(0); + auto control = hal::bit_value(0); control.set(); if (p_source == clock_source::processor) { @@ -79,7 +79,7 @@ systick_timer::~systick_timer() result systick_timer::driver_is_running() { auto running_bit = static_cast( - hal::bit::extract( + hal::bit_extract( sys_tick->control)); return is_running_t{ .is_running = running_bit }; } diff --git a/src/systick_timer_reg.hpp b/src/systick_timer_reg.hpp index c367305..387f3c7 100644 --- a/src/systick_timer_reg.hpp +++ b/src/systick_timer_reg.hpp @@ -34,26 +34,26 @@ struct systick_register_t const volatile uint32_t calib; }; -/// Namespace containing the bitmask objects that are used to manipulate the +/// Namespace containing the bit_mask objects that are used to manipulate the /// ARM Cortex Mx SysTick Timer. namespace systick_control_register { /// When set to 1, takes the contents of the reload counter, writes it to /// the current_value register and begins counting down to zero. Setting /// this to zero stops the counter. Restarting the counter will restart the /// count. -static constexpr auto enable_counter = hal::bit::mask::from<0>(); +static constexpr auto enable_counter = hal::bit_mask::from<0>(); /// When SysTick timer's count goes from 1 to 0, if this bit is set, the /// SysTick interrupt will fire. -static constexpr auto enable_interrupt = hal::bit::mask::from<1>(); +static constexpr auto enable_interrupt = hal::bit_mask::from<1>(); /// If set to 0, clock source is external, if set to 1, clock source follows /// the processor clock. -static constexpr auto clock_source = hal::bit::mask::from<2>(); +static constexpr auto clock_source = hal::bit_mask::from<2>(); /// Set to 1 when count falls from 1 to 0. This bit is cleared on the next /// read of this register. -static constexpr auto count_flag = hal::bit::mask::from<16>(); +static constexpr auto count_flag = hal::bit_mask::from<16>(); }; // namespace systick_control_register /// The address of the sys_tick register