Thread Rating:
  • 1 Vote(s) - 2 Average
  • 1
  • 2
  • 3
  • 4
  • 5
IR LIBRARY
16-12-2013, 01:09 PM, (This post was last modified: 16-12-2013, 01:12 PM by derf158.)
#11
RE: IR LIBRARY
(16-12-2013, 09:49 AM)regis Wrote: Pdl files are Pinguino's Keyword files. They help the Pinguino preprocessor to translate C++ format instructions (name.function) to SDCC-understable C instructions (functions that are in the .c file that will be included in the core program).
Please, read this :
http://wiki.pinguino.cc/index.php/How_ca...inguino%3F

Regis
i think i understand i will continue my trek.
thank you
fred

(16-12-2013, 12:47 PM)dkmorb Wrote: Hey derf158,
if you share an hw schema, we can take a look together.

Bye
ok i will attach the files i am working on.
thank you
Fred
Reply
23-12-2013, 02:18 AM, (This post was last modified: 23-12-2013, 02:30 AM by derf158.)
#12
RE: IR LIBRARY
(16-12-2013, 01:09 PM)derf158 Wrote:
(16-12-2013, 09:49 AM)regis Wrote: Pdl files are Pinguino's Keyword files. They help the Pinguino preprocessor to translate C++ format instructions (name.function) to SDCC-understable C instructions (functions that are in the .c file that will be included in the core program).
Please, read this :
http://wiki.pinguino.cc/index.php/How_ca...inguino%3F

Regis
i think i understand i will continue my trek.
thank you
fred

(16-12-2013, 12:47 PM)dkmorb Wrote: Hey derf158,
if you share an hw schema, we can take a look together.

Bye
ok i will attach the files i am working on.
thank you
Fred
dkmorb
i have attached the files the pdl is the one i created as per Regis
i have not modified the other files.

fred

(23-12-2013, 02:18 AM)derf158 Wrote:
(16-12-2013, 01:09 PM)derf158 Wrote:
(16-12-2013, 09:49 AM)regis Wrote: Pdl files are Pinguino's Keyword files. They help the Pinguino preprocessor to translate C++ format instructions (name.function) to SDCC-understable C instructions (functions that are in the .c file that will be included in the core program).
Please, read this :
http://wiki.pinguino.cc/index.php/How_ca...inguino%3F

Regis
i think i understand i will continue my trek.
thank you
fred

(16-12-2013, 12:47 PM)dkmorb Wrote: Hey derf158,
if you share an hw schema, we can take a look together.

Bye
ok i will attach the files i am working on.
thank you
Fred
dkmorb
i have attached the files the pdl is the one i created as per Regis
i have not modified the other files.

fred
Regis,
i looked at the IRremote.c file and did not see what you were telling me to rename the C++ function example IRsend:ConfusedendNEC in IRsend_sendNEC.

thanks fred


Attached Files
.c   IRremote.C (Size: 28.49 KB / Downloads: 11)
.h   IRremote.h (Size: 3.78 KB / Downloads: 5)
.h   IRremoteInt.h (Size: 13.58 KB / Downloads: 5)
.pdl   IRremote.pdl (Size: 1.36 KB / Downloads: 11)
Reply
23-12-2013, 04:08 PM,
#13
RE: IR LIBRARY
Hi,
Actually IRsend:ConfusedendNEC is a C++ syntax and SDCC is a C compiler. SDCC is simply not able to understand this kind of syntax. You have to rename it to IRsend_sendNEC for example. It seems you did it for most functions but not for all. Serial.print is also a C++ syntax you will have to replace with its C equivalent (see serial.c).
It is easier to complain than it is to do, but it is better to do than it is to complain.
Reply
01-01-2014, 02:01 AM,
#14
RE: IR LIBRARY
(23-12-2013, 04:08 PM)regis Wrote: Hi,
Actually IRsend:ConfusedendNEC is a C++ syntax and SDCC is a C compiler. SDCC is simply not able to understand this kind of syntax. You have to rename it to IRsend_sendNEC for example. It seems you did it for most functions but not for all. Serial.print is also a C++ syntax you will have to replace with its C equivalent (see serial.c).

Regis,
i have worked on the pdl and irremote.c files can you review the attached files please. i just want to make sure i am headed in the right direction i really want this library to work i thin kit will be a good addition.
thanks
fred


Attached Files
.pdl   IRremote.pdl (Size: 1.62 KB / Downloads: 6)
.c   IRremote.C (Size: 28.49 KB / Downloads: 2)
Reply
01-01-2014, 06:07 PM,
#15
RE: IR LIBRARY
Hi,
Except blank lines (delete them to speed up the translation process), your pdl file seems right. Put it in the p8/pdl directory and restart the IDE so that it can take it into account.

I noticed that your c file is still with C++ or Arduino/Pinguino syntax functions. Please replace Serial.printf, delay, pinMode and digitalWrite (maybe some others) by their respective C equivalent (see serial.c, delay.c, digitalw.c).

.c and .h files should be in p8/pinguino/libraries, so replace :
#include "IRremote.h"
#include "IRremoteInt.h"
by :
#include <IRremote.h>
#include <IRremoteInt.h>

You can not include avr/interrupt.h which is not a Pinguino or PIC header file. Delete this line.

Try an example and report all error message you will get.
Good luck.
It is easier to complain than it is to do, but it is better to do than it is to complain.
Reply
02-01-2014, 01:19 AM,
#16
RE: IR LIBRARY
(01-01-2014, 06:07 PM)regis Wrote: Hi,
Except blank lines (delete them to speed up the translation process), your pdl file seems right. Put it in the p8/pdl directory and restart the IDE so that it can take it into account.

I noticed that your c file is still with C++ or Arduino/Pinguino syntax functions. Please replace Serial.printf, delay, pinMode and digitalWrite (maybe some others) by their respective C equivalent (see serial.c, delay.c, digitalw.c).

.c and .h files should be in p8/pinguino/libraries, so replace :
#include "IRremote.h"
#include "IRremoteInt.h"
by :
#include <IRremote.h>
#include <IRremoteInt.h>

You can not include avr/interrupt.h which is not a Pinguino or PIC header file. Delete this line.

Try an example and report all error message you will get.
Good luck.
thank you i will continue my trek
Reply
06-01-2014, 02:39 AM, (This post was last modified: 06-01-2014, 02:47 AM by derf158.)
#17
RE: IR LIBRARY
(02-01-2014, 01:19 AM)derf158 Wrote:
(01-01-2014, 06:07 PM)regis Wrote: Hi,
Except blank lines (delete them to speed up the translation process), your pdl file seems right. Put it in the p8/pdl directory and restart the IDE so that it can take it into account.

I noticed that your c file is still with C++ or Arduino/Pinguino syntax functions. Please replace Serial.printf, delay, pinMode and digitalWrite (maybe some others) by their respective C equivalent (see serial.c, delay.c, digitalw.c).

.c and .h files should be in p8/pinguino/libraries, so replace :
#include "IRremote.h"
#include "IRremoteInt.h"
by :
#include <IRremote.h>
#include <IRremoteInt.h>

You can not include avr/interrupt.h which is not a Pinguino or PIC header file. Delete this line.

Try an example and report all error message you will get.
Good luck.
thank you i will continue my trek
regis
this is the error i am getting after running the blink example
Processor: 18f4550 i have attached the updated files.

sdcc: Calling preprocessor...

sdcc: Generating code...

sdcpp.exe: fatal error: when writing output to : Invalid argument

/dvpt/sdcc/sources/sdcc/src/pic16/main.c:686 setting interrupt vector addresses 0xc00

C:/Users/Brookie/Desktop/X.4/p8/pinguino/libraries/IRremote.h:27: syntax error: token -> 'decode_results' ; column 20

thank you
fred warden


Attached Files
.c   IRremote.C (Size: 28.46 KB / Downloads: 3)
.h   IRremote.h (Size: 3.89 KB / Downloads: 5)
.h   IRremoteInt.h (Size: 14.04 KB / Downloads: 3)
Reply
06-01-2014, 09:25 AM,
#18
RE: IR LIBRARY
SDCC compiler is a C-compiler and not C++. The class statement is not usable.
Therefore to return decode_results you have to define :

struct decode_results {
int decode_type; // NEC, SONY, RC5, UNKNOWN
unsigned int panasonicAddress; // This is only used for decoding Panasonic data
unsigned long value; // Decoded value
int bits; // Number of bits in decoded value
volatile unsigned int *rawbuf; // Raw intervals in .5 us ticks
int rawlen; // Number of records in rawbuf.
};
To use this kind of object you define an instance (myResults for example) :

struct decode_results myResults;

To fill this instance :
myResults.decode_type=65;
myResults.value=987654321;
etc...
Reply
07-01-2014, 01:06 AM,
#19
RE: IR LIBRARY
Hey derf158,
I attached some work I made (just a little hand, don't know if they can be useful).
It's too late for me now.

Bye.


Attached Files
.c   IRremote.C (Size: 29.01 KB / Downloads: 8)
.h   IRremote.h (Size: 4.02 KB / Downloads: 7)
Reply
07-01-2014, 03:27 AM, (This post was last modified: 07-01-2014, 03:28 AM by derf158.)
#20
RE: IR LIBRARY
(06-01-2014, 09:25 AM)gtcbreizh Wrote: SDCC compiler is a C-compiler and not C++. The class statement is not usable.
Therefore to return decode_results you have to define :

struct decode_results {
int decode_type; // NEC, SONY, RC5, UNKNOWN
unsigned int panasonicAddress; // This is only used for decoding Panasonic data
unsigned long value; // Decoded value
int bits; // Number of bits in decoded value
volatile unsigned int *rawbuf; // Raw intervals in .5 us ticks
int rawlen; // Number of records in rawbuf.
};
To use this kind of object you define an instance (myResults for example) :

struct decode_results myResults;

To fill this instance :
myResults.decode_type=65;
myResults.value=987654321;
etc...

gtcbreizh thank you for your help

(07-01-2014, 01:06 AM)dkmorb Wrote: Hey derf158,
I attached some work I made (just a little hand, don't know if they can be useful).
It's too late for me now.

Bye.


dkmorb
i will try the files your have attached.
thank you
fred
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)