Skip to content

Commit

Permalink
🐛 Fix breaks with demo building
Browse files Browse the repository at this point in the history
  • Loading branch information
kammce committed Jul 25, 2024
1 parent 8a1d7c8 commit 6f1cca2
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 26 deletions.
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

0 comments on commit 6f1cca2

Please sign in to comment.