nesC で配列を初期化するのに問題があります。
以下の行をコーディングしてプロジェクトをビルドすると、以下に示すエラーが表示されます。
nx_uint16_t file[10];
エラー:
以下の Timer0.fired() 関数では、関数の一部として配列が初期化されます。
event void Timer0.fired(){
//counter++;
//call Leds.set(counter);
printf("\nTelosb mote Timer start.");
printfflush();
if (!busy) {
BlinkToRadioMsg* btrpkt = (BlinkToRadioMsg*)(call Packet.getPayload(&pkt, sizeof
(BlinkToRadioMsg)));
printf("\nTelosb mote Timer efter busy.");
printfflush();
call Leds.led0On();
btrpkt->nodeid = 15;
btrpkt->counter = counter;
//btrpkt->hop = 1;
btrpkt->value = 2;
nx_uint16_t file[10];
nx_uint8_t j;
for ( j = 0;j<30;j++)
{
int ra = (rand()+1) % 10;
file[j]=ra;
//printf("The array : %d ", file[j]);
//printfflush();
}
if (call AMSend.send(AM_BROADCAST_ADDR, &pkt, sizeof(BlinkToRadioMsg)) == SUCCESS) {
busy = TRUE;
}
}
誰でも私を助けることができますか?