add Chapter12

This commit is contained in:
Amar Mahmutbegovic
2024-10-21 05:39:20 +02:00
parent 87087b3bfb
commit a73a8f62f1
209 changed files with 303106 additions and 0 deletions

View File

@@ -0,0 +1,21 @@
#include <gpio.hpp>
#include <gpio_interrupt_manager.hpp>
namespace hal {
gpio::gpio(const std::function<void()> & on_press) {
on_press_ = on_press;
gpio_interrupt_manager::register_interrupt_handler(this);
}
void gpio::execute_interrupt_handler () const {
if(is_interrupt_generated())
{
clear_interrupt_flag();
if(on_press_) {
on_press_();
}
}
}
};