add bootloader version retrieval
This commit is contained in:
1 parent
9f0ba29d46
commit
558aa7c717
4 files changed
+1347
-1279
No files matched your search
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,49 @@
|
||||
/*********************************************************************
|
||||
This is an example for our Feather Bluefruit 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>
|
||||
|
||||
const int baudrate = 115200;
|
||||
|
||||
/**************************************************************************/
|
||||
/*!
|
||||
@brief The setup function runs once when reset the board
|
||||
*/
|
||||
/**************************************************************************/
|
||||
void setup()
|
||||
{
|
||||
Serial.begin (baudrate);
|
||||
|
||||
Serial.println("Serial Echo demo");
|
||||
Serial.print("Badurate : ");
|
||||
Serial.println(baudrate);
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**************************************************************************/
|
||||
/*!
|
||||
@brief The loop function runs over and over again forever
|
||||
*/
|
||||
/**************************************************************************/
|
||||
void loop()
|
||||
{
|
||||
char ch;
|
||||
|
||||
// From Serial monitor to All
|
||||
if ( Serial.available() )
|
||||
{
|
||||
Serial.write( Serial.read() );
|
||||
}
|
||||
}
|
||||
@@ -18,6 +18,10 @@
|
||||
*/
|
||||
|
||||
#include "variant.h"
|
||||
#include <nrf.h>
|
||||
|
||||
// Must match temp register in bootloader
|
||||
#define BOOTLOADER_VERSION_REGISTER NRF_TIMER2->CC[0]
|
||||
|
||||
const uint32_t g_ADigitalPinMap[] = {
|
||||
// D0 - D7
|
||||
@@ -64,3 +68,10 @@ const uint32_t g_ADigitalPinMap[] = {
|
||||
31, // A7
|
||||
|
||||
};
|
||||
|
||||
uint32_t bootloaderVersion = 0;
|
||||
void initVariant()
|
||||
{
|
||||
bootloaderVersion = BOOTLOADER_VERSION_REGISTER;
|
||||
}
|
||||
|
||||
@@ -107,6 +107,14 @@ static const uint8_t SCK = PIN_SPI_SCK ;
|
||||
#define PIN_WIRE_SDA (25u)
|
||||
#define PIN_WIRE_SCL (26u)
|
||||
|
||||
/* Bootloader version, may move to other file. Assigned by
|
||||
* initVariant() upon running.
|
||||
* - value of 0x000500 is version 0.5.0
|
||||
*/
|
||||
extern uint32_t bootloaderVersion;
|
||||
|
||||
//extern void initVariant();
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in new issue
Block a user