Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
06/02/09 05:58
Read: times


 
#165724 - PC Lint warning: Toggling WatchDog
Hello,
I am having 8052 based project. I am using Keil Microvision 3 compiler and am using PC-Lint for error checking and debugging. I am using one of the Port pins of 8051 for toggling Watch dog timer hardware, which is as follows:


#include<Reg52.h> /* Keil header file for 8052 variants */

sbit W_D_TIMER = 0xb4; /*Assigning 5th pin of Port 3 , which is connected in this manner in my target hardware.

The Keil C51 Compiler provides include file Reg52.h that contain sfr, sfr16, and sbit definitions for the special function registers of various 8051 devices. The bit, sbit, sfr, and sfr16 are specific to the 8051 hardware and the C51 compiler. They are not a part of ANSI C. The sbit type defines a bit within a special function register (SFR). */

void main(void) /* code starts here */
{
--
--

while(1)/* SuperLoop that runs forever */
{
--
--
W_D_TIMER = ~W_D_TIMER; /* Toggling WatchDog hardware */
--
--
}
}
Keil compilation is ok. But, PC-Lint is generating the warning:
"Warning 514: Unusual use of a Boolean expression" for the above toggling step.
Q: What is the error in this usage?

Please suggest,

thanks

List of 11 messages in thread
TopicAuthorDate
PC Lint warning: Toggling WatchDog            01/01/70 00:00      
   How to post legible source code            01/01/70 00:00      
   Check what happens if you use !            01/01/70 00:00      
   Try This            01/01/70 00:00      
      Toggling Watchdog            01/01/70 00:00      
         Tried ! yet?            01/01/70 00:00      
            Toggling WatchDog            01/01/70 00:00      
               Still missing the point!            01/01/70 00:00      
   W_D_TIMER = 0xfffe;            01/01/70 00:00      
      It is correct for Keil            01/01/70 00:00      
         Not a hole in the C spec            01/01/70 00:00      

Back to Subject List