This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

please help "what is the wrong with this program"

hey all;
i gotto finish my semester project but i couldnt compile this program.

when i try to compile target there is an error;

The output window said completely is;
*RF_ANA_PROGRAM.C(58): error C141: syntax error near 'void'*

and the ana_program is;

#include <chipcon/hal.h>
#include <chipcon/reg1010.h>
#include <chipcon/cc1010eb.h>

void main() {

//433 MHz için kalibrasyon yapıları//

#ifdef FREQ433


// X-tal frequency: 14.745600 MHz
// RF frequency A: 433.302000 MHz Rx
// RF frequency B: 433.302000 MHz Tx
// RX Mode: Low side LO
// Frequency separation: 64 kHz
// Data rate: 19.2 kBaud
// Data Format: NRZ
// RF output power: 10 dBm
// IF/RSSI: RSSI Enabled

RF_RXTXPAIR_SETTINGS code RF_SETTINGS = {
0xA3, 0x2F, 0x0E, // Modem 0, 1 and 2
0x58, 0x00, 0x00, // Freq A
0x41, 0xFC, 0x9C, // Freq B
0x02, 0x80, // FSEP 1 and 0
0x60, // PLL_RX
0x48, // PLL_TX
0x44, // CURRENT_RX
0x81, // CURRENT_TX
0x0A, // FREND
0xFF, // PA_POW
0xC0, // MATCH
0x00, // PRESCALER
};
#endif





// Initialize peripherals
WDT_ENABLE(FALSE);
RLED_OE(TRUE); RLED = LED_OFF;
YLED_OE(TRUE); YLED = LED_OFF;
GLED_OE(TRUE); GLED = LED_ON;
BLED_OE(TRUE); BLED = LED_OFF;


// Set optimum settings for speed and low power consumption
MEM_NO_WAIT_STATES();
FLASH_SET_POWER_MODE(FLASH_STANDBY_BETWEEN_READS);

// serial port 0 settings
UART0_SETUP(38400, CC1010EB_CLKFREQ, UART_NO_PARITY | UART_RX_TX | UART_ISR);

while(1);

void isr_uart0() interrupt INUM_UART0,INUM_RF {
byte received_byte;

if (INT_GETFLAG(INUM_UART0_RX) == INT_SET) {
received_byte = UART0_RECEIVE(); //read receive buffer
INT_SETFLAG(INUM_UART0_RX, INT_CLR); // clear int


halRFSetRxTxOff(RF_TX, RF_RXTXPAIR_SETTINGS code* rf_settings, RF_RXTXPAIR_CALDATA xdata* rf_caldata);


if (INT_GETFLAG(INUM_RF) == INT_SET);
{
RF_SEND_BYTE(RF_PREAMBLE_BYTE);
halRFOverrideOutputPower(RF_TX_POWER_LOW);
RF_START_TX();
RF_SEND_BYTE(RF_SUITABLE_SYNC_BYTE);
RF_SEND_BYTE(received_byte);
GLED =~ GLED;
INT_SETFLAG(INUM_RF,INT_CLR);
halRFSetRxTxOff(RF_OFF);
}
}
else if (INT_GETFLAG(INUM_RF) == INT_SET);
{
halRFSetRxTxOff(RF_RX, RF_RXTXPAIR_SETTINGS code* rf_settings, RF_RXTXPAIR_CALDATA xdata* rf_caldata);
RF_SET_SYNC_BYTE(RF_SUITABLE_SYNC_BYTE);
RF_SET_PREAMBLE_COUNT(16);
RF_START_RX();
while (!RF_BYTE_RECEIVED());
INT_SETFLAG(INUM_RF,INT_CLR);
RF_LOCK_AVERAGE_FILTER(TRUE);
RF_RECEIVE_BYTE() = received_byte);
received_byte = UART0_SEND();
BLED =~ BLED;
INT_SETFLAG(INUM_UART0_TX, NT_CLR);
halRFSetRxTxOff(RF_OFF);
}
}
}

can you please check this program cause I am gonna get crazy.
thanks millions.(i think mr. neil can recognise the problem easily :) )

Parents
  • "i have to use these macros (am i wrong ?"

    Yes, you are wrong. You have to use those functions. Some of what you see in hal.h are macros, some are implicit-extern function declarations. halRFSetRxTxOff() is not a macro. Not that it matters, because they way you are invoking halRFSetRxTxOff(), whether it be a function or a macro, is all wrong in either case.

    "which is better? copy and past or type all these long chars with hands (its just taking time )"

    Well, copying function prototypes certainly isn't going to get you anywhere. Which is better, calling functions properly (as shown in the examples) or willy-nilly pasting of stuff that looks close enough (it's just creating problems that will take time to figure out and fix later)?

    "if you dont wanna help just do it dont help."

    If you don't wanna listen and understand, then I don't wanna help, so I'll take your advise, thank you.

Reply
  • "i have to use these macros (am i wrong ?"

    Yes, you are wrong. You have to use those functions. Some of what you see in hal.h are macros, some are implicit-extern function declarations. halRFSetRxTxOff() is not a macro. Not that it matters, because they way you are invoking halRFSetRxTxOff(), whether it be a function or a macro, is all wrong in either case.

    "which is better? copy and past or type all these long chars with hands (its just taking time )"

    Well, copying function prototypes certainly isn't going to get you anywhere. Which is better, calling functions properly (as shown in the examples) or willy-nilly pasting of stuff that looks close enough (it's just creating problems that will take time to figure out and fix later)?

    "if you dont wanna help just do it dont help."

    If you don't wanna listen and understand, then I don't wanna help, so I'll take your advise, thank you.

Children