Repository navigation
Expand file tree
/
Copy pathmain.h
More file actions
73 lines (51 loc) · 1.64 KB
/
Copy pathmain.h
File metadata and controls
73 lines (51 loc) · 1.64 KB
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
/**
* \file
* \copyright Copyright 2014 PLUX - Wireless Biosignals, S.A.
* \author Filipe Silva
* \version 1.0
* \date July 2014
*
* \section LICENSE
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#define F_CPU 8000000UL // system frequency in Hz
#include <stdbool.h>
#include <string.h>
#include <avr/io.h>
#include <avr/interrupt.h>
#include <avr/pgmspace.h>
// Macros and defines
#define B(bit) _BV(bit)
#define LEDINCR_SLOW 5
#define LEDINCR_FAST 50
#define BATTHRES_BASE 527
#include "build/pios.h" // build/pios.h is processed from pios.h
// Type definitions
typedef uint8_t byte;
typedef uint16_t word;
// Program memory variables
extern const char PROGMEM versionStr[];
// Global variables
extern word batThres;
extern byte ledIncr, seq, simulSeq, nChannels, chTable[6];
extern bool simulated;
// Global functions
// crc.c
void sendFrameCRC(const byte *frame);
// live
void timer1TickLive(void);
// simul.c
void timer1TickSimul(void);
// test.c
void testAndConfigure(void);
// uart.c
void sendProgmemStr(const char *str);