Zsolt: If the user button is connected to any of the int0, int1, int2, or int3 pins (i.e. Port D0 to Port D3), you can wire against HplAtm128Interrupt. Note that HplAtm128Interrupt provides HplAtm128Interrupt interfaces. You will want to use Atm128GpioInterruptC to convert to the GpioInterrupt interface.
You don't want to use Msp430GpioC, because that's for a completely different MCU. >From the error message you quote, I notice that you have a couple of syntax errors in the top-level code. Also, your HplUserButtonC.nc looks good, but you'll need to double check the component names (i.e. there's no such thing as Atm128GpioC). The GeneralIO interface is provided by HplAtm128GeneralIOC , you can wire that directly to the GeneralIO interface HplUserButtonC provides. Janos On Mon, Sep 27, 2010 at 2:36 PM, Zsolt Varady <[email protected]> wrote: > Dear List, > > I have a node with Atmel1281 MCU, I already have some working tinyOS > apps on it. Now I would like to implement a button, so I used > apps/tests/telosb/TestUserButton as a base. > > I copied the related files from app dir and from the telosb platform > directory as well (UserButtonP.nc, UserButton.h, UserButtonC.nc, > SwitchToggleC.nc, HplUserButtonC.nc), and even the Msp430GpioC.nc file > from chips/Msp430/pins, as it "kind of missing" in the Atmel dir. > > I tried to modify all of them to pass the Atmel MCU, but I guess I am > still missing something as I get the following error: > > In file included from ButtonsAppC.nc:15: > In component `ButtonsC': > ButtonsC.nc:48: syntax error before `button_state_t' > In file included from ButtonsAppC.nc:15: > ButtonsC.nc:49: syntax error before `button_state_t' > ButtonsC.nc:101: syntax error before `state' > ButtonsC.nc:101: unknown interface `Notify' > ButtonsC.nc: In function `Notify.notify': > ButtonsC.nc:102: `state' undeclared (first use in this function) > ButtonsC.nc:102: (Each undeclared identifier is reported only once > ButtonsC.nc:102: for each function it appears in.) > ButtonsC.nc:102: `BUTTON_PRESSED' undeclared (first use in this > function) > ButtonsC.nc:104: `BUTTON_RELEASED' undeclared (first use in this > function) > ButtonsC.nc: In function `Timer.fired': > ButtonsC.nc:110: `button_state_t' undeclared (first use in this > function) > ButtonsC.nc:110: syntax error before `bs' > ButtonsC.nc:112: `bs' undeclared (first use in this function) > ButtonsC.nc:112: `Get' undeclared (first use in this function) > ButtonsC.nc:113: `BUTTON_PRESSED' undeclared (first use in this > function) > ButtonsC.nc:115: `BUTTON_RELEASED' undeclared (first use in this > function) > In component `HplUserButtonC': > tos/platforms/plxincirc/HplUserButtonC.nc: At top level: > tos/platforms/plxincirc/HplUserButtonC.nc:48: no match > In component `ButtonsAppC': > ButtonsAppC.nc:41: cannot find `Get' > ButtonsAppC.nc:42: cannot find `Notify' > make: *** [exe0] Error 1 > > > I am quite new to tinyOS, so I am just guessing, that the problem is in > the Hpl file: > > ******************************** > configuration HplUserButtonC { > provides interface GeneralIO; > provides interface GpioInterrupt; > } > implementation { > components HplAtm128GeneralIOC as GeneralIOC; > components HplAtm128InterruptC as InterruptC; > > components new Atm128GpioC() as UserButtonC; > UserButtonC -> GeneralIOC.PortD0; // line 48 > GeneralIO = UserButtonC; > > components new Atm128GpioInterruptC() as InterruptUserButtonC; > InterruptUserButtonC.Atm128Interrupt -> InterruptC.Int0; > GpioInterrupt = InterruptUserButtonC.Interrupt; > } > ******************************** > > or in Atm128GpioC: > > ******************************** > generic module Atm128GpioC() @safe() { > provides interface GeneralIO; > uses interface HplAtm128GeneralIO as HplGeneralIO; > } > implementation { > > async command void GeneralIO.set() { call HplGeneralIO.set(); } > async command void GeneralIO.clr() { call HplGeneralIO.clr(); } > async command void GeneralIO.toggle() { call HplGeneralIO.toggle(); } > async command bool GeneralIO.get() { return call HplGeneralIO.get(); } > async command void GeneralIO.makeInput() { call > HplGeneralIO.makeInput(); } > async command bool GeneralIO.isInput() { return call > HplGeneralIO.isInput(); } > async command void GeneralIO.makeOutput() { call > HplGeneralIO.makeOutput(); } > async command bool GeneralIO.isOutput() { return call > HplGeneralIO.isOutput(); } > > } > ******************************** > > > Any help, suggestion would be very nice. > Thanks in advance. > > All the best, > Zsolt > > _______________________________________________ > Tinyos-help mailing list > [email protected] > https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help > _______________________________________________ Tinyos-help mailing list [email protected] https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
