meaning of timer-- ??

Discussion in 'Embedded Systems and Microcontrollers' started by embed_v, Jan 13, 2011.

  1. embed_v

    Thread Starter New Member

    Aug 30, 2010
    24
    0
    Hiii
    tell me what is the meaning of red line
    __irq void Timer0ISR(void)
    {
    if (Timer1)
    Timer1--


    thanx
     
  2. nerdegutta

    Moderator

    Dec 15, 2009
    2,515
    785
    The value of Timer1 is decreased by 1...

    It is the opposite of Timer1++, which increase the value of Timer1 by 1...
     
  3. Papabravo

    Expert

    Feb 24, 2006
    10,135
    1,786
    In this case it does not matter, but the decrementing of Timer1 happens AFTER the value of Timer1 is used in the expression. If the decrement operator is placed before the expression then the decrementing takes place BEFOR the expression is used.
    Code ( (Unknown Language)):
    1.  
    2. Timer1--     // A post-decremnt operation
    3. --Timer1     // A pre-decremnt
    4.  
     
Loading...