Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 3 additions & 8 deletions .clangd
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
If:
PathMatch: demos/.*
CompileFlags:
CompilationDatabase: demos
Else:
CompileFlags:
CompilationDatabase: .

CompileFlags:
CompilationDatabase: .
BuiltinHeaders: QueryDriver
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2024 Khalil Estell
# Copyright 2024 - 2025 Khalil Estell and the libhal contributors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/take.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2024 Khalil Estell
# Copyright 2024 - 2025 Khalil Estell and the libhal contributors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/update_name.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2024 Khalil Estell
# Copyright 2024 - 2025 Khalil Estell and the libhal contributors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
4 changes: 2 additions & 2 deletions ARCHITECTURE.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,8 @@ bootstrap.module.add_demo_requirements(self)
```

Must be invoked in order to add the appropriate platform libraries to the
`ConanFile` class. These platform libraries are usually `libhal-lpc40`,
`libhal-stm32f1` and `libhal-micromod`. Note that bootstrap must be updated to
`ConanFile` class. These platform libraries are usually `libhal-arm-mcu`,
`libhal-linux` and `libhal-micromod`. Note that bootstrap must be updated to
support additional platforms. If you attempt to use a profile with a platform
name outside of what is supported by `libhal-bootstrap` then this API does
nothing except include `libhal-util`.
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2024 Khalil Estell
# Copyright 2024 - 2025 Khalil Estell and the libhal contributors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
4 changes: 2 additions & 2 deletions conanfile.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2024 Khalil Estell
# Copyright 2024 - 2025 Khalil Estell and the libhal contributors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -26,7 +26,7 @@ class libhal___device___conan(ConanFile):
topics = ("__device__", "libhal", "driver")
settings = "compiler", "build_type", "os", "arch"

python_requires = "libhal-bootstrap/[^4.2.1]"
python_requires = "libhal-bootstrap/[>=4.3.0 <5]"
python_requires_extend = "libhal-bootstrap.library"

def requirements(self):
Expand Down
2 changes: 1 addition & 1 deletion demos/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2024 Khalil Estell
# Copyright 2024 - 2025 Khalil Estell and the libhal contributors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion demos/applications/__device__.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2024 Khalil Estell
// Copyright 2024 - 2025 Khalil Estell and the libhal contributors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
4 changes: 2 additions & 2 deletions demos/conanfile.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2024 Khalil Estell
# Copyright 2024 - 2025 Khalil Estell and the libhal contributors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -15,7 +15,7 @@


class demos(ConanFile):
python_requires = "libhal-bootstrap/[^4.2.1]"
python_requires = "libhal-bootstrap/[>=4.3.0 <5]"
python_requires_extend = "libhal-bootstrap.demo"

def requirements(self):
Expand Down
2 changes: 1 addition & 1 deletion demos/main.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2024 Khalil Estell
// Copyright 2024 - 2025 Khalil Estell and the libhal contributors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion demos/platforms/lpc4078.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2024 Khalil Estell
// Copyright 2024 - 2025 Khalil Estell and the libhal contributors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion demos/platforms/micromod.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2024 Khalil Estell
// Copyright 2024 - 2025 Khalil Estell and the libhal contributors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion demos/platforms/stm32f103c8.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2024 Khalil Estell
// Copyright 2024 - 2025 Khalil Estell and the libhal contributors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion demos/resource_list.hpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2024 Khalil Estell
// Copyright 2024 - 2025 Khalil Estell and the libhal contributors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
6 changes: 4 additions & 2 deletions include/libhal-__device__/__device__.hpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2024 Khalil Estell
// Copyright 2024 - 2025 Khalil Estell and the libhal contributors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand All @@ -16,5 +16,7 @@

namespace hal::__device__ { // NOLINT
struct __device___replace_me // NOLINT
{};
{
__device___replace_me();
};
} // namespace hal::__device__
17 changes: 15 additions & 2 deletions src/__device__.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2024 Khalil Estell
// Copyright 2024 - 2025 Khalil Estell and the libhal contributors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand All @@ -14,5 +14,18 @@

#include "libhal-__device__/__device__.hpp"

namespace hal::__device__ { // NOLINT
namespace {
int do_something_variable = 0;
}

namespace hal::__device__ {
__device___replace_me::__device___replace_me()
{
// Do nothing here, but give something to be contained in the .a archive file.
// Otherwise `apple-clang` tends to get upset with a message:
//
// ld: archive member '/' not a mach-o file in 'libhal-__device__.a'
//
do_something_variable++;
}
} // namespace hal::__device__
6 changes: 2 additions & 4 deletions test_package/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2024 Khalil Estell
# Copyright 2024 - 2025 Khalil Estell and the libhal contributors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -13,12 +13,10 @@
# limitations under the License.

cmake_minimum_required(VERSION 3.15)

project(test_package LANGUAGES CXX)

find_package(libhal-__device__ REQUIRED CONFIG)

add_executable(${PROJECT_NAME} main.cpp)
target_include_directories(${PROJECT_NAME} PUBLIC .)
target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_20)
set_target_properties(${PROJECT_NAME} PROPERTIES CXX_EXTENSIONS OFF)
target_link_libraries(${PROJECT_NAME} PRIVATE libhal::__device__)
4 changes: 2 additions & 2 deletions test_package/conanfile.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2024 Khalil Estell
# Copyright 2024 - 2025 Khalil Estell and the libhal contributors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -17,7 +17,7 @@

class TestPackageConan(ConanFile):
settings = "os", "arch", "compiler", "build_type"
python_requires = "libhal-bootstrap/[^4.2.1]"
python_requires = "libhal-bootstrap/[>=4.3.0 <5]"
python_requires_extend = "libhal-bootstrap.library_test_package"

def requirements(self):
Expand Down
2 changes: 1 addition & 1 deletion test_package/main.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2024 Khalil Estell
// Copyright 2024 - 2025 Khalil Estell and the libhal contributors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
3 changes: 2 additions & 1 deletion tests/__device__.test.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2024 Khalil Estell
// Copyright 2024 - 2025 Khalil Estell and the libhal contributors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand All @@ -23,6 +23,7 @@ boost::ut::suite test___device__ = []() { // NOLINT

"__device__::__device__()"_test = []() {
// Setup
[[maybe_unused]] hal::__device__::__device___replace_me bar;
// Exercise
// Verify
};
Expand Down
2 changes: 1 addition & 1 deletion tests/main.test.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2024 Khalil Estell
// Copyright 2024 - 2025 Khalil Estell and the libhal contributors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
Loading