Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 Fix breaks with demo building #46

Merged
merged 1 commit into from
Jul 25, 2024
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
2 changes: 1 addition & 1 deletion demos/applications/multi_levels.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ int funct_group6_0();

using signature = int(void);

std::array<signature*, 9> functions = {
std::array functions{
&funct_group0_0, &funct_group1_0, &funct_group2_0, &funct_group3_0,
&funct_group4_0, &funct_group5_0, &funct_group6_0,
#if 0
Expand Down
20 changes: 0 additions & 20 deletions demos/applications/single_level.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,38 +26,18 @@ struct error
std::uint64_t start = 0;
std::uint64_t end = 0;

std::uint64_t volatile entry_search_start = 0;
std::uint64_t volatile entry_search_end = 0;

void foo()
{
if (value) {
start = resources->clock->uptime();
throw error{ .data = value };
}
}
namespace ke {
struct index_entry_t
{
uint32_t a;
uint32_t b;
};
extern index_entry_t const& get_index_entry(std::uint32_t p_program_counter);
} // namespace ke

ke::index_entry_t const* global_index = nullptr;
std::uint64_t volatile search_time = 0;

void application(resource_list& p_resources)
{
resources = &p_resources;

entry_search_start = resources->clock->uptime();
global_index = &ke::get_index_entry(reinterpret_cast<std::uint32_t>(&foo));
entry_search_end = resources->clock->uptime();

search_time = entry_search_end - entry_search_start;

try {
foo();
} catch (error const& p_error) {
Expand Down
6 changes: 1 addition & 5 deletions demos/platforms/stm32f103r6.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,7 @@
resource_list initialize_platform()
{
using namespace hal::literals;
hal::stm32f1::maximum_speed_using_internal_oscillator();

auto cpu_frequency = hal::stm32f1::frequency(hal::stm32f1::peripheral::cpu);
static hal::cortex_m::dwt_counter dwt_steady_clock(cpu_frequency);

static hal::cortex_m::dwt_counter dwt_steady_clock(10.0_MHz);
return {
.clock = &dwt_steady_clock,
};
Expand Down
4 changes: 3 additions & 1 deletion src/control.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,9 @@ class single_exception_allocator : public std::pmr::memory_resource
{
public:
single_exception_allocator() = default;
~single_exception_allocator() = default;
virtual ~single_exception_allocator() override
{
}

private:
void* do_allocate(std::size_t p_size,
Expand Down
Loading