Hi all. I encountered a line of code from some timer examples given by Nick Gammon, at:
https://www.gammon.com.au/forum/?id=11504
The particular line of code I'm trying to understand (how it works) for his "Frequency Counter sketch for Atmega2560" example is:
if (TIFR5 & TOV5)
TIFR5 is a timer interrupt flag register for timer 5. I can understand that part.
As for the TOV5 value..... I've read already that TOV5 represents the 'timer overflow' bit of the TIFR5 register. From what I've seen so far in the user manuals, the TOV5 bit is bit0 (right-most bit) of the TIFR5 register.
So the value of TOV5 equal to zero?
And the code: TIFR5 & TOV5 means a bitwise AND operation between TIFR5 and TOV5, so is it a bitwise AND operation between TIFR5 (in binary form) and 00000000 ? Probably not! So thought I'd just ask about this one.
Thanks for helping in advance!!