Skip to content
Snippets Groups Projects
Select Git revision
  • b3a87ecad4002df2a3a1531ef817ed2ead0fc9cb
  • main default
  • vue-update
  • fixnogg
  • futurenogg
  • positions
  • emoji
  • minorUI
  • markdown
  • stayConnected
  • gm-test
  • shortcut
  • connectPouchDB
  • master protected
14 results

AddNodes-old.vue

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++;
    }