]>
git.gir.st - tmk_keyboard.git/blob - tmk_core/tool/mbed/mbed-sdk/libraries/mbed/common/board.c
1 /* mbed Microcontroller Library
2 * Copyright (c) 2006-2013 ARM Limited
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
18 #include "toolchain.h"
19 #include "mbed_interface.h"
21 WEAK
void mbed_die(void) {
23 __disable_irq(); // dont allow interrupts to disturb the flash pattern
25 #if (DEVICE_ERROR_RED == 1)
26 gpio_t led_red
; gpio_init_out(&led_red
, LED_RED
);
27 #elif (DEVICE_ERROR_PATTERN == 1)
28 gpio_t led_1
; gpio_init_out(&led_1
, LED1
);
29 gpio_t led_2
; gpio_init_out(&led_2
, LED2
);
30 gpio_t led_3
; gpio_init_out(&led_3
, LED3
);
31 gpio_t led_4
; gpio_init_out(&led_4
, LED4
);
35 #if (DEVICE_ERROR_RED == 1)
36 gpio_write(&led_red
, 1);
38 #elif (DEVICE_ERROR_PATTERN == 1)
39 gpio_write(&led_1
, 1);
40 gpio_write(&led_2
, 0);
41 gpio_write(&led_3
, 0);
42 gpio_write(&led_4
, 1);
47 #if (DEVICE_ERROR_RED == 1)
48 gpio_write(&led_red
, 0);
50 #elif (DEVICE_ERROR_PATTERN == 1)
51 gpio_write(&led_1
, 0);
52 gpio_write(&led_2
, 1);
53 gpio_write(&led_3
, 1);
54 gpio_write(&led_4
, 0);