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
30 changes: 30 additions & 0 deletions v5/include/libhal-util/macros.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
// Copyright 2026 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.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

#pragma once

#if defined(__clang__)
#define SUPPRESS_DEPRECATED_START \
_Pragma("clang diagnostic push") \
_Pragma("clang diagnostic ignored \"-Wdeprecated-declarations\"")
#define SUPPRESS_DEPRECATED_END _Pragma("clang diagnostic pop")
#elif defined(__GNUC__)
#define SUPPRESS_DEPRECATED_START \
_Pragma("GCC diagnostic push") \
_Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"")
#define SUPPRESS_DEPRECATED_END _Pragma("GCC diagnostic pop")
#else
#define SUPPRESS_DEPRECATED_START
#define SUPPRESS_DEPRECATED_END
#endif
14 changes: 9 additions & 5 deletions v5/include/libhal-util/usb/enumerator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,18 @@
#include <optional>
#include <span>
#include <string_view>
#include <tuple>
#include <utility>

#include <libhal/error.hpp>
#include <libhal/pointers.hpp>
#include <libhal/scatter_span.hpp>
#include <libhal/units.hpp>
#include <libhal/usb.hpp>

#include "../as_bytes.hpp"
#include "../macros.hpp"
#include "../scatter_span.hpp"
#include "descriptors.hpp"
#include "libhal-util/as_bytes.hpp"
#include "libhal-util/scatter_span.hpp"
#include "libhal-util/usb/endpoints.hpp"
#include "endpoints.hpp"
#include "utils.hpp"

namespace hal::v5::usb {
Expand Down Expand Up @@ -67,6 +66,10 @@ class enumerator
, m_retry_max(p_args.retry_max)
{
m_ctrl_ep->on_receive([this](control_endpoint::on_receive_tag) {
// NOTE: These APIs will be replaced in a future update (see PR
// https://github.com/libhal/libhal-util/pull/100/changes), so suppressing
// them for now.
SUPPRESS_DEPRECATED_START;
if (!this->m_ctrl_ep->has_setup().has_value()) {
m_has_setup_packet =
true; // We will just assume the packet is a setup packet, enumerator
Expand All @@ -75,6 +78,7 @@ class enumerator
}

m_has_setup_packet = this->m_ctrl_ep->has_setup().value();
SUPPRESS_DEPRECATED_END;
});
}

Expand Down
2 changes: 1 addition & 1 deletion v5/test_package/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class TestPackageConan(ConanFile):
generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv"

def build_requirements(self):
self.tool_requires("cmake/3.27.1")
self.tool_requires("cmake/[^4.0.0]")

def requirements(self):
self.requires(self.tested_reference_str)
Expand Down
Loading