Hi all, I am working on GPIO usage on Iris motes. While using AtmegaGeneralIOP.nc component it is giving the following error log for all functions:
/opt/MoteWorks/tos/platform/atm1281/AtmegaGeneralIOP.nc: In function `Pin.isOutput': /opt/MoteWorks/tos/platform/atm1281/AtmegaGeneralIOP.nc:57: implicit declaration of function `TCAST' /opt/MoteWorks/tos/platform/atm1281/AtmegaGeneralIOP.nc:57: syntax error before `volatile' In one of the post in this forum I found this one - https://www.millennium.berkeley.edu/pipermail/tinyos-devel/2008-February/002504.html. But couldn't understand what he is trying to say, as I didn't find any of the folder/file name he is mentioning. Thanks. Srikanth. Find the attached code of AtmegaGeneralIOP.nc for your reference. generic module AtmegaGeneralIOP(uint8_t port_addr, uint8_t ddr_addr, uint8_t pin_addr) @safe() { provides interface GeneralIO as Pin[uint8_t bit]; } implementation { #define pin (*TCAST(volatile uint8_t * ONE, pin_addr)) #define port (*TCAST(volatile uint8_t * ONE, port_addr)) #define ddr (*TCAST(volatile uint8_t * ONE, ddr_addr)) inline async command bool Pin.get[uint8_t bit]() { return (pin & (1<<bit)) != 0; } inline async command void Pin.set[uint8_t bit]() { port |= 1<<bit; } inline async command void Pin.clr[uint8_t bit]() { port &= ~(1<<bit); } inline async command void Pin.toggle[uint8_t bit]() { atomic port ^= 1 <<bit; } inline async command void Pin.makeInput[uint8_t bit]() { ddr &= ~(1<<bit); } inline async command bool Pin.isInput[uint8_t bit]() { return (ddr & (1<<bit)) == 0; } inline async command void Pin.makeOutput[uint8_t bit]() { ddr |= 1<<bit; } inline async command bool Pin.isOutput[uint8_t bit]() { return (ddr & (1<<bit)) != 0;} }
_______________________________________________ Tinyos-help mailing list [email protected] https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
