mirror of https://github.com/ARMmbed/mbed-os.git
Merge branch 'master' of https://github.com/mbedmicro/mbed
commit
c0263fdf4d
|
@ -16,7 +16,7 @@
|
||||||
#ifndef MBED_H
|
#ifndef MBED_H
|
||||||
#define MBED_H
|
#define MBED_H
|
||||||
|
|
||||||
#define MBED_LIBRARY_VERSION 80
|
#define MBED_LIBRARY_VERSION 81
|
||||||
|
|
||||||
#include "platform.h"
|
#include "platform.h"
|
||||||
|
|
||||||
|
|
|
@ -19,11 +19,11 @@
|
||||||
|
|
||||||
WEAK void mbed_die(void);
|
WEAK void mbed_die(void);
|
||||||
WEAK void mbed_die(void) {
|
WEAK void mbed_die(void) {
|
||||||
|
#ifndef NRF51_H
|
||||||
__disable_irq(); // dont allow interrupts to disturb the flash pattern
|
__disable_irq(); // dont allow interrupts to disturb the flash pattern
|
||||||
|
#endif
|
||||||
#if (DEVICE_ERROR_RED == 1)
|
#if (DEVICE_ERROR_RED == 1)
|
||||||
gpio_t led_red; gpio_init_out(&led_red, LED_RED);
|
gpio_t led_red; gpio_init_out(&led_red, LED_RED);
|
||||||
|
|
||||||
#elif (DEVICE_ERROR_PATTERN == 1)
|
#elif (DEVICE_ERROR_PATTERN == 1)
|
||||||
gpio_t led_1; gpio_init_out(&led_1, LED1);
|
gpio_t led_1; gpio_init_out(&led_1, LED1);
|
||||||
gpio_t led_2; gpio_init_out(&led_2, LED2);
|
gpio_t led_2; gpio_init_out(&led_2, LED2);
|
||||||
|
|
|
@ -18,8 +18,8 @@
|
||||||
static inline void _gpio_init_in(gpio_t* gpio, PinName pin, PinMode mode)
|
static inline void _gpio_init_in(gpio_t* gpio, PinName pin, PinMode mode)
|
||||||
{
|
{
|
||||||
gpio_init(gpio, pin);
|
gpio_init(gpio, pin);
|
||||||
gpio_mode(gpio, mode);
|
|
||||||
gpio_dir(gpio, PIN_INPUT);
|
gpio_dir(gpio, PIN_INPUT);
|
||||||
|
gpio_mode(gpio, mode);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void _gpio_init_out(gpio_t* gpio, PinName pin, PinMode mode, int value)
|
static inline void _gpio_init_out(gpio_t* gpio, PinName pin, PinMode mode, int value)
|
||||||
|
|
|
@ -44,24 +44,11 @@ void SystemCoreClockUpdate(void)
|
||||||
|
|
||||||
void SystemInit(void)
|
void SystemInit(void)
|
||||||
{
|
{
|
||||||
NRF_NVMC->CONFIG = (NVMC_CONFIG_WEN_Wen << NVMC_CONFIG_WEN_Pos);
|
|
||||||
while (NRF_NVMC->READY == NVMC_READY_READY_Busy){
|
|
||||||
}
|
|
||||||
//write FWID (NRF_UICR->FWID is readonly)
|
|
||||||
*(uint32_t *)0x10001010 = 0xFFFF0049;
|
|
||||||
|
|
||||||
while (NRF_NVMC->READY == NVMC_READY_READY_Busy){
|
|
||||||
}
|
|
||||||
|
|
||||||
NRF_NVMC->CONFIG = (NVMC_CONFIG_WEN_Ren << NVMC_CONFIG_WEN_Pos);
|
|
||||||
while (NRF_NVMC->READY == NVMC_READY_READY_Busy){
|
|
||||||
}
|
|
||||||
// Prepare the peripherals for use as indicated by the PAN 26 "System: Manual setup is required
|
// Prepare the peripherals for use as indicated by the PAN 26 "System: Manual setup is required
|
||||||
// to enable the use of peripherals" found at Product Anomaly document for your device found at
|
// to enable the use of peripherals" found at Product Anomaly document for your device found at
|
||||||
// https://www.nordicsemi.com/. The side effect of executing these instructions in the devices
|
// https://www.nordicsemi.com/. The side effect of executing these instructions in the devices
|
||||||
// that do not need it is that the new peripherals in the second generation devices (LPCOMP for
|
// that do not need it is that the new peripherals in the second generation devices (LPCOMP for
|
||||||
// example) will not be available.
|
// example) will not be available.
|
||||||
|
|
||||||
if (is_manual_peripheral_setup_needed()){
|
if (is_manual_peripheral_setup_needed()){
|
||||||
*(uint32_t volatile *)0x40000504 = 0xC007FFDF;
|
*(uint32_t volatile *)0x40000504 = 0xC007FFDF;
|
||||||
*(uint32_t volatile *)0x40006C18 = 0x00008000;
|
*(uint32_t volatile *)0x40006C18 = 0x00008000;
|
||||||
|
|
|
@ -103,8 +103,8 @@ typedef enum {
|
||||||
LED3 = p18,
|
LED3 = p18,
|
||||||
LED4 = p19,
|
LED4 = p19,
|
||||||
|
|
||||||
BUTTON0 = p16,
|
BUTTON1 = p16,
|
||||||
BUTTON1 = p17,
|
BUTTON2 = p17,
|
||||||
|
|
||||||
RX_PIN_NUMBER = p11,
|
RX_PIN_NUMBER = p11,
|
||||||
TX_PIN_NUMBER = p9,
|
TX_PIN_NUMBER = p9,
|
||||||
|
|
|
@ -50,6 +50,8 @@
|
||||||
|
|
||||||
#define DEVICE_STDIO_MESSAGES 0
|
#define DEVICE_STDIO_MESSAGES 0
|
||||||
|
|
||||||
|
#define DEVICE_ERROR_PATTERN 1
|
||||||
|
|
||||||
#include "objects.h"
|
#include "objects.h"
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -29,6 +29,7 @@ volatile uint16_t timeStamp=0;
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
void TIMER1_IRQHandler(void){
|
void TIMER1_IRQHandler(void){
|
||||||
|
|
||||||
if ((US_TICKER_TIMER->EVENTS_COMPARE[1] != 0) &&
|
if ((US_TICKER_TIMER->EVENTS_COMPARE[1] != 0) &&
|
||||||
((US_TICKER_TIMER->INTENSET & TIMER_INTENSET_COMPARE1_Msk) != 0))
|
((US_TICKER_TIMER->INTENSET & TIMER_INTENSET_COMPARE1_Msk) != 0))
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue