Hi All,
I have some problem in compiling my code. I get the following error when i
compile the source:
mkdir -p build/telosb
compiling ListenerAppC to a telosb binary
ncc -o build/telosb/main.exe -Os -O -mdisable-hwmul -Wall -Wshadow
-Wnesc-all -target=telosb -fnesc-cfile=build/telosb/app.c -board=
-DDEFINED_TOS_AM_GROUP=0x22 -I/opt/tinyos-2.1.0/tos/lib/printf
-DCC2420_DEF_RFPOWER=31 -DPACKET_LINK -DTOSH_DATA_LENGTH=110
-DIDENT_APPNAME=\"ListenerAppC\" -DIDENT_USERNAME=\"nithin\"
-DIDENT_HOSTNAME=\"venus\" -DIDENT_USERHASH=0x162b6f44L
-DIDENT_TIMESTAMP=0x49fe920dL -DIDENT_UIDHASH=0xbc6f3be8L ListenerAppC.nc
-lm
/opt/tinyos-2.1.0/tos/chips/cc2420/lpl/DummyLplC.nc:39:2: warning: #warning
"*** LOW POWER COMMUNICATIONS DISABLED ***"
/opt/tinyos-2.1.0/tos/chips/cc2420/link/PacketLinkC.nc:38:2: warning:
#warning "*** USING PACKET LINK LAYER"
ListenerC.nc: In function `ListenerC$enqueue':
ListenerC.nc:208: internal error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.
make: *** [exe0] Error 1
The following is the code for the *enqueue* function
178 void enqueue(uint8_t stop_id)
179 {
180 detect_msg_t temp;
181 uint64_t fst,lst,avg;
182
183 temp.busstop_id = stop_id;
184
185 fst = ( (((uint64_t)(fstPacket[stop_id -1].hours)) * 60 * 60) +
(((uint64_t)(fstPacket[stop_id -1].minutes)) * 60) + ((uint64_t)
stPacket[stop_ id-1].seconds)) );
186 lst = ( (((uint64_t)(lstPacket[stop_id -1].hours)) * 60 * 60) +
(((uint64_t)(lstPacket[stop_id -1].minutes)) * 60) +
((uint64_t)(lstPacket[stop_ id-1].seconds)) );
187 avg = (fst + lst) / 2 ;
188
189
190 temp.arrival_time.hours = ((uint8_t)(avg / 3600));
191 avg %= 3600;
192 temp.arrival_time.minutes = ((uint8_t)(avg / 60));
193 avg %= 60;
194 temp.arrival_time.seconds = ((uint8_t)(avg)) ;
195
196
197
198 if(index == 15)
199 index = 0;
200
201 buffer[index].busstop_id = temp.busstop_id;
202 buffer[index].arrival_time.hours = temp.arrival_time.hours;
203 buffer[index].arrival_time.minutes = temp.arrival_time.minutes;
204 buffer[index].arrival_time.seconds = temp.arrival_time.seconds;
205
206
207 index++;
208
209 }
When i comment the lines from 190 to 195, there is no error in compilation.
Is there any problem in typecasting 64 bit to 8 bit ?
~nithind
_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help