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

clean up app code #5

Merged
merged 1 commit into from
Jul 9, 2023
Merged
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
5 changes: 4 additions & 1 deletion Src/Target/Stm32f446re/Mcal/mcal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,15 @@ namespace local
extern "C"
void mcal_init(void)
{
mcal::gpt::init(nullptr);

// Enable the GPIOG peripheral clock
mcal::reg::reg_access_static<std::uint32_t, std::uint32_t, mcal::reg::rcc_ahb1enr, static_cast<std::uint32_t>(UINT8_C(1))>::reg_or();

// Configure the GPIO pin to output mode
mcal::reg::reg_access_static<std::uint32_t, std::uint32_t, mcal::reg::gpioa_moder, static_cast<std::uint32_t>((1U << (5U * 2U)))>::reg_or();
mcal::reg::reg_access_static<std::uint32_t, std::uint32_t, mcal::reg::gpioa_moder, static_cast<std::uint32_t>(~(1U << ((5U * 2U) + 1U)))>::reg_and();

mcal::gpt::init(nullptr);

// Enable global interrupts.
asm volatile("cpsie i");
Expand Down