Skip to content
Snippets Groups Projects
Select Git revision
  • 3bdb824822bd477cf51997a357fec61e511ee40b
  • dev default
  • 61-feature-add-optional-backwards-mapping-for-consistency-with-older-version
  • 61-feature-add-optional-backwards-mapping-for-consistency-with-older-version-2
  • main protected
  • 11-test-fix-tests-to-handle-licensed-data-resources-from-trud-snd-omop
  • general
  • pypi
  • old-main
  • v0.0.3
10 results

parse.html

Blame
  • time.cpp 524 B
    #include "time.hpp"
    
    #include <avr/io.h>
    #include <avr/interrupt.h>
    #include <stdint.h>
    
    static uint32_t millis;
    
    void initTime()
    {
        cli();
        
        TCCR0A = (1 << WGM01);              // CTC mode, TOP = OCRA
        TCCR0B = (1 << CS01) | (1 << CS00); // 64th prescaler
        OCR0A = 249;                        // set TOP for 1 kHz interrupts
        TIMSK0 = (1 << OCIE0A);             // enable compare A interrupt
        
        sei();
    }
    
    uint32_t getCurrentMillis()
    {
        return millis;
    }
    
    ISR(TIMER0_COMPA_vect)
    {
        millis++;
    }