bthnycl / tinyos-main

Automatically exported from code.google.com/p/tinyos-main
0 stars 0 forks source link

atm128rfa1 PIN G5 does not work - there is typo #70

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Try to toggle port G5

// pseudo code that does not work
components HplAtm128GeneralIOC as GeneralIOC;
App.G5 -> GeneralIOC.PortG5;

call G5.makeOutput();
call G5.toggle();

// pseudo code that works
DDRG = DDRG | (1<<5);
PORTG = PORTG & ~(1<<5);

PORTG = PORTG ^ (1<<5); // toggle

What is the expected output? What do you see instead?
Port should toggle, but it does not do anything - it works with direct AVR 
commands.

What version of the product are you using? On what operating system?
r5753

Please provide any additional information below.

Problem is in file: tos/chips/atm128rfa1/pins/HplAtm128GeneralIOC.nc

line 136: new HplAtm128GeneralIOSlowPinP((uint8_t)&PORTG, (uint8_t)&DDRG, 
(uint8_t)&PING, 4) as G5

should be new HplAtm128GeneralIOSlowPinP((uint8_t)&PORTG, (uint8_t)&DDRG, 
(uint8_t)&PING, 5) as G5

Note that currently G4 and G5 are the same.

And what about comment: "PortG only exposes 5 bits and cannot use sbi, cbi"
Actually sbi and cbi can be used.

Original issue reported on code.google.com by andres.v...@smartdustsolutions.com on 7 Oct 2011 at 9:52

GoogleCodeExporter commented 9 years ago
Reworked the HplAtm128GeneralIOC component, now it is called AtmegaGeneralIOC 
and it should work for all ports with the same code. The compiler will make the 
correct decision whether to use sbi/cbi or something more complicated.

Original comment by mmar...@gmail.com on 11 Oct 2011 at 9:09