mbed library sources: Modified to operate FRDM-KL25Z at 48MHz from internal 32kHz oscillator (nothing else changed).
Fork of mbed-src by
board.c
00001 /* mbed Microcontroller Library 00002 * Copyright (c) 2006-2013 ARM Limited 00003 * 00004 * Licensed under the Apache License, Version 2.0 (the "License"); 00005 * you may not use this file except in compliance with the License. 00006 * You may obtain a copy of the License at 00007 * 00008 * http://www.apache.org/licenses/LICENSE-2.0 00009 * 00010 * Unless required by applicable law or agreed to in writing, software 00011 * distributed under the License is distributed on an "AS IS" BASIS, 00012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 00013 * See the License for the specific language governing permissions and 00014 * limitations under the License. 00015 */ 00016 #include "gpio_api.h" 00017 #include "wait_api.h" 00018 #include "toolchain.h" 00019 00020 WEAK void mbed_die(void); 00021 WEAK void mbed_die(void) { 00022 #if defined(DEVICE_ERROR_RED) 00023 gpio_t led_red; gpio_init(&led_red, LED_RED, PIN_OUTPUT); 00024 00025 #elif defined(DEVICE_ERROR_PATTERN) 00026 gpio_t led_1; gpio_init(&led_1, LED1, PIN_OUTPUT); 00027 gpio_t led_2; gpio_init(&led_2, LED2, PIN_OUTPUT); 00028 gpio_t led_3; gpio_init(&led_3, LED3, PIN_OUTPUT); 00029 gpio_t led_4; gpio_init(&led_4, LED4, PIN_OUTPUT); 00030 #endif 00031 00032 while (1) { 00033 #if defined(DEVICE_ERROR_RED) 00034 gpio_write(&led_red, 1); 00035 00036 #elif defined(DEVICE_ERROR_PATTERN) 00037 gpio_write(&led_1, 1); 00038 gpio_write(&led_2, 0); 00039 gpio_write(&led_3, 0); 00040 gpio_write(&led_4, 1); 00041 #endif 00042 wait_ms(150); 00043 00044 #if defined(DEVICE_ERROR_RED) 00045 gpio_write(&led_red, 0); 00046 00047 #elif defined(DEVICE_ERROR_PATTERN) 00048 gpio_write(&led_1, 0); 00049 gpio_write(&led_2, 1); 00050 gpio_write(&led_3, 1); 00051 gpio_write(&led_4, 0); 00052 #endif 00053 wait_ms(150); 00054 } 00055 }
Generated on Wed Jul 13 2022 19:29:54 by 1.7.2