-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathfps.cpp
More file actions
27 lines (19 loc) · 725 Bytes
/
fps.cpp
File metadata and controls
27 lines (19 loc) · 725 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
/*
* Copyright Ben XO https://github.com/ben-xo All rights reserved.
*/
#include "fps.h"
uint32_t start_time = 0; // time each loop started.
uint32_t silent_since = 0; // time we've been silent since.
uint32_t last_delay = 0;
int8_t volatile fps_interrupt_count = FPS_INTERRUPT_RESET_VAL;
void setup_fps() {
// // TIMER1 is used for the sampler. We are going to piggy back on Timer 1 to get an interrupt to use for keeping the frame rate steady.
// OCR1B = 0;
// // enable timer compare interrupt
// TIMSK1 |= (1 << OCIE1B);
}
/* N.B. we apply fps_count() in ledpwm.cpp in order to efficiently share an interrupt */
// ISR(TIMER1_COMPB_vect)
// {
// fps_count(SAMP_FREQ / FPS); // defined in header.
// }