Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compiles on recent versions of avr-gcc & multiple sleep bugfixes #1

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Commits on Sep 7, 2014

  1. Replaced deprecated interrupt names

    All deprecated interrupt names have been replaced by their
    current equivalents:
    
        SIG_OVERFLOW0   -> TIMER0_OVF_vect
        SIG_PIN_CHANGE2 -> PCINT2_vect
        SIG_PIN_CHANGE0 -> PCINT0_vect
        SIG_INTERRUPT0  -> INT0_vect
        SIG_COMPARATOR  -> ANALOG_COMP_vect
    
    The code no longer generates compile errors on recent versions of GCC.
    (Tested on avr-gcc 4.8.2.)
    John Archie committed Sep 7, 2014
    Configuration menu
    Copy the full SHA
    95aec9f View commit details
    Browse the repository at this point in the history
  2. Multiple sleep-related bugfixes

    This commit includes four sleep-related bugfixes.  Together, these
    changes should ensure more reliable sleep behavior.
    
    The code now uses a 2 MHz clock speed during sleep--fast enough for
    reliable asynchronous timer (timer2) operation, but slow enough for
    oscillator stability at 1.7 volts, the lowest possible voltage ensured
    by the BOD settings.
    
    Timer2 is now initialized only if not already initialized.  This
    prevents time loss due to the unnecessary reinitializations after
    calls to app_start().
    
    The sleep code now ensures that all asynchronous timer settings are
    latched before sleeping to ensure reliable waking via the once-per-
    second time keeping interrupt.
    
    The once-per-second interrupt must not exit before a full crystal
    oscillation, so OCR2B--an unused timer2 register--is written at the
    beginning of the interrupt routine.  The value of OCR2B is latched
    after two positive edges from the crystal oscillator, and since the
    system will not sleep until all asynchronous timer (timer2) registers
    are latched, the system will not sleep until the necessary time has
    passed.
    John Archie committed Sep 7, 2014
    Configuration menu
    Copy the full SHA
    2d841a4 View commit details
    Browse the repository at this point in the history