-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.cpp
52 lines (35 loc) · 887 Bytes
/
main.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#include "config/stm32plus.h"
#include "config/gpio.h"
#include "config/timing.h"
#include "config/timer.h"
#include "config/debug.h"
#include "config/exti.h"
#include "IR.h"
//por um vector a C com 40 posiçoes...
using namespace stm32plus;
/*
* Main entry point
*/
int main() {
shost << "\fSTART\n";
// set up SysTick at 1ms resolution
MillisecondTimer::initialise();
GpioA<DefaultDigitalOutputFeature<5> > LED;
// GpioC<DefaultDigitalInputFeature<13> > B;
Nvic::initialise();
IR _ir;
IR::IR_PACKAGE IR_CODE;
//The interrupts are enable, so it will capture any package
while(1){
//lets wait for the complete package
while(!_ir.IsReadComplete()){
asm("nop");
}
// _ir.Semihost_print_pck();
_ir.decode(&IR_CODE);
if(IR_CODE.code==SAMSUNG_KEY_1)
LED[5].setState(!LED[5].read() );
}
// not reached
return 0;
}