Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[SOLVED] BitWise Operators in MPLAB-X

Status
Not open for further replies.

ste2006

Advanced Member level 4
Joined
May 1, 2012
Messages
118
Helped
3
Reputation
6
Reaction score
3
Trophy points
1,298
Activity points
2,226
I have the below snippet of code in a function but when i complile it is giving me an error around my else Statement,

What is the error with this line, I want to AND SysFlags with Hex Value FFFD with the result to be placed back in SysFlags


Code C - [expand]
1
2
3
4
5
6
7
8
9
10
11
12
unsigned int Reboot (unsigned char action, unsigned int SysFlags)
{
    int TempSysFlags = 0x00;
    if (action == 1);                       // Start Reboot
    {
        SysFlags |= 0x02;                   // Set Flag High
    }
    else
    {
        SysFlags &= 0xFFFD;
    }
}



---------- Post added at 11:56 ---------- Previous post was at 11:53 ----------

Sorry, Syntax Error
 
Last edited by a moderator:

The semicolon shouldn't exist at the end of
Code:
if (action == 1);
 

Yes thanks copped it after i had posted
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top