Hallo Leute!
Ich bin gerade dabei das IRMP auf nem 8-Bitter (PIC16F1823) zu
portieren. Der Compiler ist CCS C Compiler.
Habe aus meiner Sicht alles beachtet, was im Artikel
(http://www.mikrocontroller.net/articles/IRMP#F_INTERRUPTS) von Frank
M., für die Portierung notwendig ist. Habe den Timerinterrupt auf 15625
interrupts pro Sec. eingestellt. Die main()-Routine habe euch mal unten
abgedruckt.
Jedoch habe ich Probleme mit den Funktionen, die in der irmp.h stehen:
1 | extern void irmp_init (void);
|
2 | extern uint8_t irmp_get_data (IRMP_DATA *);
|
3 | extern uint8_t irmp_is_busy (void);
|
4 | extern uint8_t irmp_ISR (void);
|
Mein Compiler bringt hierbei immer die Fehlermeldung: "Error 112
"main.c" Line 35(1,1): Function used but not defined: ... irmp_get_data
SCR=1896"
Kommentiere ich nun
1 | if (irmp_get_data(&irmp_data)...
|
in meiner main.c aus erscheint die Meldung: "Error 112 "main.c" Line
14(1,1): Function used but not defined: ... irmp_ISR SCR=1875 1
Errors"
Irgendwie werden die Funktionsprototypen nicht erkannt.
Habt ihr ne Idee an was es liegen könnte? Hat der CCS C Compiler
Probleme mit external functions?
Schonmal vielen Dank!
Shottky
Hier noch meine main.c:
1 | #include <16F1823.h>
|
2 | #fuses NOMCLR,NOPROTECT,NOWDT
|
3 | #use delay(clock = 32000000) // Quarz 32 MHz
|
4 |
|
5 | #include "irmp.h"
|
6 |
|
7 | #INT_TIMER0
|
8 | void testfunc_for_timer(){
|
9 |
|
10 | //delay_ms(2000);
|
11 | output_high(PIN_C0); // LED ON
|
12 | //delay_ms(1000);
|
13 | //output_low(PIN_C0); //LED OFF
|
14 | irmp_ISR();
|
15 | }
|
16 |
|
17 | void main(){
|
18 |
|
19 | setup_oscillator(OSC_16MHZ);
|
20 |
|
21 | // set port c as an output
|
22 | set_tris_c(0b0000000);
|
23 |
|
24 | setup_timer_0 (RTCC_INTERNAL|RTCC_DIV_1|RTCC_8_BIT); //(32Mhz/4)/RTCC_DIV_1=15625 interrupts per second
|
25 | enable_interrupts(INT_TIMER0);
|
26 | enable_interrupts(GLOBAL);
|
27 | set_timer0(0); //
|
28 |
|
29 | while(true){
|
30 |
|
31 |
|
32 | IRMP_DATA irmp_data;
|
33 |
|
34 | output_low(PIN_C0); // LED OFF
|
35 | //if (irmp_get_data(&irmp_data))
|
36 | //{
|
37 | // ir signal decoded, do something here...
|
38 | // irmp_data.protocol is the protocol, see irmp.h
|
39 | // irmp_data.address is the address/manufacturer code of ir sender
|
40 | // irmp_data.command is the command code
|
41 | // irmp_protocol_names[irmp_data.protocol] is the protocol name (if enabled, see irmpconfig.h)
|
42 | //}
|
43 |
|
44 |
|
45 | }// end while
|
46 | }// end main()
|