Skip to content

Commit

Permalink
Merge pull request #5 from imahjoub/3-add-docs
Browse files Browse the repository at this point in the history
clean up app code
  • Loading branch information
imahjoub authored Jul 9, 2023
2 parents 0459366 + 822afdf commit 614fb9a
Showing 1 changed file with 4 additions and 1 deletion.
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

0 comments on commit 614fb9a

Please sign in to comment.