yarf 0.1
Yet Another RepRap Firmware
Defines | Functions | Variables
src/hardware/clock.c File Reference

Real-time clock for counting the uptime and for providing a time base for periodic tasks. More...

#include "clock.h"
#include "yarf.h"
#include "fastio.h"
#include "scheduling/periodic.h"
#include "scheduling/periodic_notify.h"
#include "movement/advance.h"
#include "util/math.h"
#include <avr/interrupt.h>
#include <util/atomic.h>

Go to the source code of this file.

Defines

#define TIMER_TICKS_PER_MS   (F_CPU/8/1000)
 The number of ticks the hardware timer will take in one millisecond.

Functions

static void timer1_init (void)
 Initializes the hardware timer.
 ISR (TIMER1_COMPB_vect, ISR_NOBLOCK)
 Interrupt service routine which is executed every millisecond.
void clock_init (void)
 Initializes the clock component.
unsigned long clock_millis (void)
 Returns the number of milliseconds passed since the clock was initialized.

Variables

static volatile unsigned long millis
 The number of milliseconds passed since the clock was initialized.

Detailed Description

Real-time clock for counting the uptime and for providing a time base for periodic tasks.

Author:
Pieter Agten (pieter.agten@gmail.com)
Date:
30 okt 2011

Definition in file clock.c.


Function Documentation

ISR ( TIMER1_COMPB_vect  ,
ISR_NOBLOCK   
)

Interrupt service routine which is executed every millisecond.

This routine increments millis by one and notifies the periodic scheduler that a millisecond has passed.

Definition at line 98 of file clock.c.

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines