void main(void)
{
init();
InitUSART();
while (1)
{
if(RB1 == 0) //Is this a switch? There's no debounce routine.
{
RB2 = 0x1; //Invalid value for a single bit, can be 0x00 or 0x01 only
RB3 = 0x04; //Same issue here.
send_msg("at+cmgf=1");
enter();
DelayMs(50);
send_msg("at+cmgs=");
send_msg("+6582543453");
enter();
DelayMs(50);
send_msg("hello");
tx_start();
DelayMs(5000);
RB2 = 0x0;
}
else if(RB1=1) //Here you're assigning a value to RB1, you need to use
{ //else if(RB1==1)
RB2 = 0x0;
RB3 = 0x0;
}
}
}