File tree Expand file tree Collapse file tree 7 files changed +20
-21
lines changed
libraries/Bluefruit52Lib/examples/Hardware/hwinfo Expand file tree Collapse file tree 7 files changed +20
-21
lines changed Original file line number Diff line number Diff line change @@ -70,7 +70,6 @@ metro52.build.board=METRO52
70
70
metro52.build.core=nRF5
71
71
metro52.build.variant=metro52
72
72
73
-
74
73
# Debug Menu
75
74
metro52.menu.debug.l0=Level 0 (Release)
76
75
metro52.menu.debug.l0.build.debug_flags=-DCFG_DEBUG=0
Original file line number Diff line number Diff line change @@ -64,7 +64,6 @@ static void loop_task(void* arg)
64
64
int main ( void )
65
65
{
66
66
init ();
67
-
68
67
initVariant ();
69
68
70
69
if (setLoopStacksize)
Original file line number Diff line number Diff line change @@ -28,6 +28,10 @@ extern "C" {
28
28
#define BOOTLOADER_DFU_SERIAL_MAGIC 0x4e
29
29
#define BOOTLOADER_DFU_OTA_FULLRESET_MAGIC 0xA8
30
30
31
+ // Must match temp register in bootloader
32
+ #define BOOTLOADER_VERSION_REGISTER NRF_TIMER2->CC[0]
33
+ uint32_t bootloaderVersion = 0 ;
34
+
31
35
void init ( void )
32
36
{
33
37
#if defined( USE_LFXO )
@@ -41,6 +45,16 @@ void init( void )
41
45
#endif
42
46
43
47
NRF_CLOCK -> TASKS_LFCLKSTART = 1UL ;
48
+
49
+ // Retrieve bootloader version
50
+ bootloaderVersion = BOOTLOADER_VERSION_REGISTER ;
51
+
52
+ // RTC1 could be enabled by bootloader. Disable it
53
+ NVIC_DisableIRQ (RTC1_IRQn );
54
+ NRF_RTC1 -> EVTENCLR = RTC_EVTEN_COMPARE0_Msk ;
55
+ NRF_RTC1 -> INTENCLR = RTC_INTENSET_COMPARE0_Msk ;
56
+ NRF_RTC1 -> TASKS_STOP = 1 ;
57
+ NRF_RTC1 -> TASKS_CLEAR = 1 ;
44
58
}
45
59
46
60
void enterSerialDfu (void )
Original file line number Diff line number Diff line change @@ -27,6 +27,11 @@ extern void init(void);
27
27
extern void enterSerialDfu (void );
28
28
extern void enterOTADfu (void );
29
29
30
+ /* Bootloader version. Assigned by init().
31
+ * - value of 0x000500 is version 0.5.0
32
+ */
33
+ extern uint32_t bootloaderVersion ;
34
+
30
35
// Hint instruction to tell CPU go to low power mode
31
36
#if 0
32
37
#define waitForEvent () __WFE()
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ typedef volatile uint32_t REG32;
11
11
void setup () {
12
12
Serial.begin (115200 );
13
13
14
- Serial.println (" Bluefruit Feather 52 HW Info" );
14
+ Serial.println (" Bluefruit 52 HW Info" );
15
15
Serial.println (" " );
16
16
17
17
// MAC Address
Original file line number Diff line number Diff line change @@ -68,21 +68,8 @@ const uint32_t g_ADigitalPinMap[] = {
68
68
69
69
};
70
70
71
- // Must match temp register in bootloader
72
- #define BOOTLOADER_VERSION_REGISTER NRF_TIMER2->CC[0 ]
73
- uint32_t bootloaderVersion = 0 ;
74
-
75
71
void initVariant ()
76
72
{
77
- bootloaderVersion = BOOTLOADER_VERSION_REGISTER;
78
-
79
- // RTC1 is already configured by bootloader. Disable it here
80
- NVIC_DisableIRQ (RTC1_IRQn);
81
- NRF_RTC1->EVTENCLR = RTC_EVTEN_COMPARE0_Msk;
82
- NRF_RTC1->INTENCLR = RTC_INTENSET_COMPARE0_Msk;
83
- NRF_RTC1->TASKS_STOP = 1 ;
84
- NRF_RTC1->TASKS_CLEAR = 1 ;
85
-
86
73
// LED1 & LED2
87
74
pinMode (PIN_LED1, OUTPUT);
88
75
ledOff (PIN_LED1);
Original file line number Diff line number Diff line change @@ -116,11 +116,6 @@ static const uint8_t SCK = PIN_SPI_SCK ;
116
116
#define PIN_WIRE_SDA (25u)
117
117
#define PIN_WIRE_SCL (26u)
118
118
119
- /* Bootloader version, may move to other file. Assigned by
120
- * initVariant() upon running.
121
- * - value of 0x000500 is version 0.5.0
122
- */
123
- extern uint32_t bootloaderVersion ;
124
119
125
120
static inline bool isPinValid (uint32_t pin )
126
121
{
You can’t perform that action at this time.
0 commit comments