summaryrefslogtreecommitdiff
path: root/bootloader/avr_code/bootloadercfg.h
blob: c756366533a5d85879e89a0a69c3488615c83559 (plain)
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
/*
 * A sysex bootloader for avr chips.
 * Copyright 2010 Alex Norman
 *
 * This file is part of SysexBoot.
 *
 * SysexBoot 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.
 *
 * SysexBoot 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 SysexBoot.  If not, see <http://www.gnu.org/licenses/>.
 *
 */

#ifndef BOOTLOADERCFG_H
#define BOOTLOADERCFG_H

/*

//turn on port b bit zero as input
//turn on pullups
#define BOOTLOADER_INIT \
	DDRB = 0xFE; \
	PORTB = 0x01;

//a zero tells us that the button is down
#define BOOTLOADER_CONDITION (!(PINB & _BV(PINB0)))
*/

//turn on port b bit zero as input
//turn on pullups
#ifndef BOOTLOADER_INIT
#define BOOTLOADER_INIT
#endif

//a zero tells us that the button is down
#ifndef BOOTLOADER_CONDITION
#define BOOTLOADER_CONDITION (!(PIND & _BV(PIND4)))
#endif

#ifndef INDICATE_BOOTLOADER_MODE
#define INDICATE_BOOTLOADER_MODE \
	PORTB = 170;
#endif

//could be reduced [probably] to decrease ram size, but needs to be at least 43
//long in current implementation
#ifndef MIDIIN_BUF_SIZE
#define MIDIIN_BUF_SIZE 128
#endif

#endif