Skip to content
This repository has been archived by the owner on Aug 18, 2024. It is now read-only.

Commit

Permalink
⬆️ libhal-armcortex/3.0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
kammce committed Mar 11, 2024
1 parent f7f9d9c commit 23265f2
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 43 deletions.
11 changes: 11 additions & 0 deletions .github/workflows/0.0.2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: 🚀 Release 0.0.2

on:
workflow_dispatch:

jobs:
deploy:
uses: ./.github/workflows/deploy-version.yml
with:
version: 0.0.2
secrets: inherit
16 changes: 5 additions & 11 deletions conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,10 @@ class libhal_stm32f4_conan(ConanFile):
homepage = "https://libhal.github.io/libhal-stm32f4"
description = ("A collection of drivers and libraries for the stm32f4 "
"series microcontrollers.")
topics = ("arm", "microcontroller", "stm32f4",)
topics = ("arm", "microcontroller", "stm32f4")
settings = "compiler", "build_type", "os", "arch"
exports_sources = ("include/*", "linker_scripts/*", "tests/*", "LICENSE",
"CMakeLists.txt", "src/*")

python_requires = "libhal-bootstrap/[^0.0.4]"

python_requires = "libhal-bootstrap/[^1.0.0]"
python_requires_extend = "libhal-bootstrap.library"

options = {
Expand All @@ -50,18 +48,14 @@ def package_id(self):
def _use_linker_script(self):
return (self.options.platform == "stm32f411re")

@property
def _bare_metal(self):
return self.settings.os == "baremetal"

def requirements(self):
self.requires("libhal-armcortex/[^3.0.0]")
self.requires("libhal-armcortex/[^3.0.2]", transitive_headers=True)

def package_info(self):
self.cpp_info.libs = ["libhal-stm32f4"]
self.cpp_info.set_property("cmake_target_name", "libhal::stm32f4")

if self._bare_metal and self._use_linker_script:
if self.settings.os == "baremetal" and self._use_linker_script:
linker_path = os.path.join(self.package_folder, "linker_scripts")
link_script = "-Tlibhal-stm32f4/" + \
str(self.options.platform) + ".ld"
Expand Down
4 changes: 1 addition & 3 deletions demos/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,7 @@ libhal_build_demos(

PACKAGES
libhal-stm32f4
libhal-exceptions


LINK_LIBRARIES
libhal::stm32f4
libhal::exceptions
)
20 changes: 9 additions & 11 deletions demos/applications/blinker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,24 +17,22 @@
#include <libhal-util/serial.hpp>
#include <libhal-util/steady_clock.hpp>

void delay_by_cycles(int cycles);
void delay_by_cycles(int p_cycles)
{
volatile int i = 0;
while (i < p_cycles) {
i = i + 1;
}
}

void application()
{
using namespace hal::literals;
hal::stm32f4::output_pin led(hal::stm32f4::peripheral::gpio_a, 5);
led.level(true);

while (true) {
led.level(false);
delay_by_cycles(1000000);
led.level(true);
delay_by_cycles(1000000);
}
}

void delay_by_cycles(int cycles)
{
volatile int i = 0;
while (i < cycles) {
i = i + 1;
}
}
5 changes: 1 addition & 4 deletions demos/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,11 @@

class demos(ConanFile):
settings = "compiler", "build_type", "os", "arch", "libc"
options = {"platform": ["ANY"]}
default_options = {"platform": "unspecified"}

python_requires = "libhal-bootstrap/[^0.0.4]"
python_requires = "libhal-bootstrap/[^1.0.0]"
python_requires_extend = "libhal-bootstrap.demo"

def requirements(self):
bootstrap = self.python_requires["libhal-bootstrap"]
bootstrap.module.add_demo_requirements(self, is_platform=True)
self.requires("libhal-exceptions/[^0.0.1]")
self.requires("libhal-stm32f4/[>=0.0.1]")
13 changes: 1 addition & 12 deletions demos/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,12 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#include <libhal-armcortex/startup.hpp>
#include <libhal-armcortex/system_control.hpp>
#include <libhal/error.hpp>

// Application function must be implemented by one of the compilation units
// (.cpp) files.
extern void application();

int main()
{
try {
Expand All @@ -28,13 +27,3 @@ int main()
}
return 0;
}

extern "C"
{
struct _reent* _impure_ptr = nullptr; // NOLINT

void _exit([[maybe_unused]] int rc) // NOLINT
{
std::terminate();
}
}
4 changes: 2 additions & 2 deletions test_package/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@

class TestPackageConan(ConanFile):
settings = "os", "arch", "compiler", "build_type"
python_requires = "libhal-bootstrap/[^0.0.4]"

python_requires = "libhal-bootstrap/[^1.0.0]"
python_requires_extend = "libhal-bootstrap.library_test_package"

def requirements(self):
Expand Down

0 comments on commit 23265f2

Please sign in to comment.