udpate bootloader, add dfu_serial enter sketch

This commit is contained in:
hathach committed 2017-03-16 21:03:49 +07:00
1 parent a1c3cc04dc
commit fd386cce43
4 files changed
+1356 -1313

No files matched your search

File diff suppressed because it is too large. Load diff
+14
View File
@@ -25,6 +25,8 @@
extern "C" {
#endif
#define BOOTLOADER_DFU_START_SERIAL 0x4e
void init( void )
{
#if defined( USE_LFXO )
@@ -40,6 +42,18 @@ void init( void )
NRF_CLOCK->TASKS_LFCLKSTART = 1UL;
}
void enterSerialDFU(void)
{
NRF_POWER->GPREGRET = BOOTLOADER_DFU_START_SERIAL;
NVIC_SystemReset();
}
void enterOtaDFU(void)
{
}
#ifdef __cplusplus
}
#endif
+3
View File
@@ -24,6 +24,9 @@ extern "C" {
extern void init(void);
extern void enterSerialDFU(void);
extern void enterOtaDFU(void);
#ifdef __cplusplus
}
#endif
@@ -0,0 +1,26 @@
/*********************************************************************
This is an example for our nRF52 based Bluefruit LE modules
Pick one up today in the adafruit shop!
Adafruit invests time and resources providing this open source code,
please support Adafruit and open-source hardware by purchasing
products from Adafruit!
MIT license, check LICENSE for more information
All text above, and the splash screen below must be included in
any redistribution
*********************************************************************/
#include <Arduino.h>
void setup()
{
enterSerialDFU();
}
void loop()
{
}