Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed LoRaWAN-lib SX1276Lib
Diff: board/board.cpp
- Revision:
- 9:ee9dcbb9708d
- Parent:
- 1:352f608c3337
--- a/board/board.cpp Tue Apr 04 13:43:31 2017 +0000
+++ b/board/board.cpp Mon Apr 24 13:38:31 2017 +0000
@@ -17,6 +17,28 @@
SX1276MB1xAS Radio( NULL );
+/*!
+ * Nested interrupt counter.
+ *
+ * \remark Interrupt should only be fully disabled once the value is 0
+ */
+static uint8_t IrqNestLevel = 0;
+
+void BoardDisableIrq( void )
+{
+ __disable_irq( );
+ IrqNestLevel++;
+}
+
+void BoardEnableIrq( void )
+{
+ IrqNestLevel--;
+ if( IrqNestLevel == 0 )
+ {
+ __enable_irq( );
+ }
+}
+
void BoardInit( void )
{
TimerTimeCounterInit( );