fix RTC1 compare interrupt is not clear by bootloader

This commit is contained in:
hathach committed 2017-04-12 12:43:33 +07:00
1 parent b37b8bcb77
commit 117d251d4b
3 files changed
+10 -8

No files matched your search

@@ -77,16 +77,9 @@
typedef void (*TaskFunction_t)( void * );
/* Converts a time in milliseconds to a time in ticks. */
#if configTICK_RATE_HZ == 1000
#define ms2tick(ms) (ms)
#define tick2ms(tck) (tck)
#define tick2us(tck) (1000*(tck))
#else
#define ms2tick( xTimeInMs ) ( ( TickType_t ) ( ( ( TickType_t ) ( xTimeInMs ) * ( TickType_t ) configTICK_RATE_HZ ) / ( TickType_t ) 1000 ) )
#define tick2ms(tck) ( ( ((uint64_t)(tck)) * 1000) / configTICK_RATE_HZ )
#define tick2us(tck) ( ( ((uint64_t)(tck)) * 1000000) / configTICK_RATE_HZ )
#endif
#define pdFALSE ( ( BaseType_t ) 0 )
#define pdTRUE ( ( BaseType_t ) 1 )
@@ -115,7 +108,7 @@ typedef void (*TaskFunction_t)( void * );
/* The following endian values are used by FreeRTOS+ components, not FreeRTOS
itself. */
#define pdFREERTOS_LITTLE_ENDIAN 0
#define pdFREERTOS_BIG_ENDIAN 1
#define pdFREERTOS_BIG_ENDIAN 1
#endif /* PROJDEFS_H */
@@ -28,6 +28,8 @@ void setup()
Bluefruit.setConnLedInterval(250);
Bluefruit.Central.setScanCallback(scan_callback);
Bluefruit.Central.startScanning();
Serial.println("Scanning ...");
}
void scan_callback(ble_gap_evt_adv_report_t* report)
+7
View File
@@ -76,6 +76,13 @@ void initVariant()
{
bootloaderVersion = BOOTLOADER_VERSION_REGISTER;
// RTC1 is already configured by bootloader. Disable it here
NVIC_DisableIRQ(RTC1_IRQn);
NRF_RTC1->EVTENCLR = RTC_EVTEN_COMPARE0_Msk;
NRF_RTC1->INTENCLR = RTC_INTENSET_COMPARE0_Msk;
NRF_RTC1->TASKS_STOP = 1;
NRF_RTC1->TASKS_CLEAR = 1;
// LED1 & LED2
pinMode(PIN_LED1, OUTPUT);
ledOff(PIN_LED1);