Root/cntr/fw/common/config.h

1/*
2 * common/config.h - Configuration data for boot loader and application
3 *
4 * Written 2010 by Werner Almesberger
5 * Copyright 2010 Werner Almesberger
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 */
12
13#ifndef CONFIG_H
14#define CONFIG_H
15
16#include "io.h"
17#include "io-parts.h"
18#include "cntr/usb-ids.h"
19
20
21/* ----- Boot loader configuration ----------------------------------------- */
22
23/*
24 * Disable the watchdog.
25 */
26
27#define PLATFORM_SETUP \
28    PCA0MD = 0;
29
30
31/*
32 * Make LED output push-pull so that we can output a high voltag, then enable
33 * the crossbar. This turns on the LED, to indicate that we're in the boot
34 * loader.
35 */
36
37#define PLATFORM_ENTER \
38    LEDv1_MODE |= 1 << LEDv1_BIT; \
39    LEDv2_MODE |= 1 << LEDv2_BIT; \
40    XBR1 = XBARE
41
42
43/*
44 * Turn off the LED when we exit the boot loader.
45 */
46
47#define PLATFORM_EXIT \
48    LEDv1 = 0; \
49    LEDv2 = 0
50
51#endif /* !CONFIG_H */
52

Archive Download this file



interactive