Hi

it works. I get a normal response from the local compiler.
Now, the only difference with the webcompiler is that I get some 
errors like those:

(1) testIO.c with these includes:
#include "stdio.h"
#include "stdlib.h"
#include "unistd.h"
#include "sys/ioctl.h"
#include "fcntl.h"
#include "time.h"
#include "string.h"
#include "linux/gpio_syscalls.h"
...
Errors:
/usr/local/cris/lib/gcc-lib/cris-axis-linux-
gnu/3.2.1/include/stdio.h: 554: parse error before "__THROW" (*)
...
testIO.c: 2:20: stdlib.h: No such file or directory
...
testIO.c: 8:33: linux/gpio_syscalls.h: No such file or directory
...
testIO.c: 22: 'PG8-15' undeclared (first use in this function)
...
(2) testIO.c with these others includes:
#include "stdio.h"
#include "stdlib.h"
#include "/home/fox/devboard-R2_01/target/cris-axis-linux-
gnu/include/asm/unistd.h"
#include "/home/fox/devboard-R2_01/target/cris-axis-linux-
gnu/include/asm/ioctl.h"
#include "/home/fox/devboard-R2_01/target/cris-axis-linux-
gnu/include/asm/fcntl.h"
#include "time.h"
#include "/home/fox/devboard-R2_01/target/cris-axis-linux-
gnu/include/asm/string.h"
#include "/home/fox/devboard-R2_01/target/cris-axis-linux-
gnu/include/linux/gpio_syscalls.h"
...
Errors:
it still appears the errors like (*) and it appears others related to 
the functions in gpio_syscalls.h

In both cases I finally get the "make: *** [testIO.o] Error 1". If I 
use the same testIO.c (1) with the webcompiler, it finishes correctly 
without errors or warnings. Why don't I obtain the same result in 
both sdk's?

Thanks a lot.

(P.D.: This is the standard gpio_syscalls.h that use my environment:
#ifndef __LINUX_SYSCALL_GPIO
#define __LINUX_SYSCALL_GPIO
#include <linux/config.h>
#include <linux/kernel.h>
#include <linux/errno.h>
#include <asm/unistd.h>

// port defines
#define PORTA   'A'
#define PORTB   'B'
#define PORTG   'G'

//direction defines
#define DIRIN   'I'
#define DIROUT  'O'

// pin defines for PORTG
#define PG0     (1<<0)
#define PG1     (1<<1)
#define PG2     (1<<2)
#define PG3     (1<<3)
#define PG4     (1<<4)
#define PG5     (1<<5)
#define PG6     (1<<6)
#define PG7     (1<<7)
#define PG8     (1<<8)
#define PG9     (1<<9)
#define PG10    (1<<10)
#define PG11    (1<<11)
#define PG12    (1<<12)
#define PG13    (1<<13)
#define PG14    (1<<14)
#define PG15    (1<<15)
#define PG16    (1<<16)
#define PG17    (1<<17)
#define PG18    (1<<18)
#define PG19    (1<<19)
#define PG20    (1<<20)
#define PG21    (1<<21)
#define PG22    (1<<22)
#define PG23    (1<<23)
#define PG24    (1<<24)

#define PG8_15  0x00ff00
#define PG16_23 0xff0000


// pin defines for PORTA
#define PA0     (1<<0)
#define PA1     (1<<1)
#define PA2     (1<<2)
#define PA3     (1<<3)
#define PA4     (1<<4)
#define PA5     (1<<5)
#define PA6     (1<<6)
#define PA7     (1<<7)

// pin defines for PORTB
#define PB0     (1<<0)
#define PB1     (1<<1)
#define PB2     (1<<2)
#define PB3     (1<<3)
#define PB4     (1<<4)
#define PB5     (1<<5)
#define PB6     (1<<6)
#define PB7     (1<<7)

extern int errno;
_syscall2(void, gpiosetbits, unsigned char, port, unsigned int, bits);
_syscall2(void, gpioclearbits, unsigned char, port, unsigned int, 
bits);
_syscall3(void, gpiosetdir, unsigned char, port, unsigned char, dir, 
unsigned int, bits);
_syscall2(void, gpiotogglebit, unsigned char, port, unsigned int, 
bits);
_syscall2(unsigned int, gpiogetbits, unsigned char, port, unsigned 
int, bits);

#endif
)


Reply via email to