28 lines
567 B
C++
28 lines
567 B
C++
/*
|
|
* ExampleInterruptibleClass.cpp
|
|
*
|
|
* Created on: Apr 20, 2024
|
|
* Author: Gabriel
|
|
*/
|
|
|
|
#include "ExampleInterruptibleClass.hpp"
|
|
#include <cstdio>
|
|
|
|
ExampleInterruptibleClass::ExampleInterruptibleClass(GPIO_Pin* pin) : pin(pin) {
|
|
|
|
}
|
|
|
|
ExampleInterruptibleClass::~ExampleInterruptibleClass() {
|
|
// TODO Auto-generated destructor stub
|
|
}
|
|
|
|
int32_t ExampleInterruptibleClass::init(){
|
|
int32_t errors = 0;
|
|
errors += pin->registerExtiCallback(this);
|
|
return errors;
|
|
}
|
|
|
|
void ExampleInterruptibleClass::irqHandler(InterruptReason* reason){
|
|
printf("Interrupted\n");
|
|
}
|