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: LoRaWAN-lib-2 SingleFrequencyLora
Fork of events_ex_1 by
board/board.cpp@5:03a258cb2893, 2017-12-13 (annotated)
- Committer:
- Rishin
- Date:
- Wed Dec 13 21:32:53 2017 +0000
- Revision:
- 5:03a258cb2893
- Parent:
- 4:0fde6ac73e8a
commit for publish - encryption reinstated
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| Rishin | 4:0fde6ac73e8a | 1 | /* |
| Rishin | 4:0fde6ac73e8a | 2 | / _____) _ | | |
| Rishin | 4:0fde6ac73e8a | 3 | ( (____ _____ ____ _| |_ _____ ____| |__ |
| Rishin | 4:0fde6ac73e8a | 4 | \____ \| ___ | (_ _) ___ |/ ___) _ \ |
| Rishin | 4:0fde6ac73e8a | 5 | _____) ) ____| | | || |_| ____( (___| | | | |
| Rishin | 4:0fde6ac73e8a | 6 | (______/|_____)_|_|_| \__)_____)\____)_| |_| |
| Rishin | 4:0fde6ac73e8a | 7 | (C)2015 Semtech |
| Rishin | 4:0fde6ac73e8a | 8 | |
| Rishin | 4:0fde6ac73e8a | 9 | Description: Target board general functions implementation |
| Rishin | 4:0fde6ac73e8a | 10 | |
| Rishin | 4:0fde6ac73e8a | 11 | License: Revised BSD License, see LICENSE.TXT file include in the project |
| Rishin | 4:0fde6ac73e8a | 12 | |
| Rishin | 4:0fde6ac73e8a | 13 | Maintainer: Miguel Luis and Gregory Cristian |
| Rishin | 4:0fde6ac73e8a | 14 | */ |
| Rishin | 4:0fde6ac73e8a | 15 | #include "mbed.h" |
| Rishin | 4:0fde6ac73e8a | 16 | #include "board.h" |
| Rishin | 4:0fde6ac73e8a | 17 | |
| Rishin | 4:0fde6ac73e8a | 18 | SX1276MB1xAS Radio( NULL ); |
| Rishin | 4:0fde6ac73e8a | 19 | |
| Rishin | 4:0fde6ac73e8a | 20 | /*! |
| Rishin | 4:0fde6ac73e8a | 21 | * Nested interrupt counter. |
| Rishin | 4:0fde6ac73e8a | 22 | * |
| Rishin | 4:0fde6ac73e8a | 23 | * \remark Interrupt should only be fully disabled once the value is 0 |
| Rishin | 4:0fde6ac73e8a | 24 | */ |
| Rishin | 4:0fde6ac73e8a | 25 | static uint8_t IrqNestLevel = 0; |
| Rishin | 4:0fde6ac73e8a | 26 | |
| Rishin | 4:0fde6ac73e8a | 27 | void BoardDisableIrq( void ) |
| Rishin | 4:0fde6ac73e8a | 28 | { |
| Rishin | 4:0fde6ac73e8a | 29 | __disable_irq( ); |
| Rishin | 4:0fde6ac73e8a | 30 | IrqNestLevel++; |
| Rishin | 4:0fde6ac73e8a | 31 | } |
| Rishin | 4:0fde6ac73e8a | 32 | |
| Rishin | 4:0fde6ac73e8a | 33 | void BoardEnableIrq( void ) |
| Rishin | 4:0fde6ac73e8a | 34 | { |
| Rishin | 4:0fde6ac73e8a | 35 | IrqNestLevel--; |
| Rishin | 4:0fde6ac73e8a | 36 | if( IrqNestLevel == 0 ) |
| Rishin | 4:0fde6ac73e8a | 37 | { |
| Rishin | 4:0fde6ac73e8a | 38 | __enable_irq( ); |
| Rishin | 4:0fde6ac73e8a | 39 | } |
| Rishin | 4:0fde6ac73e8a | 40 | } |
| Rishin | 4:0fde6ac73e8a | 41 | |
| Rishin | 4:0fde6ac73e8a | 42 | void BoardInit( void ) |
| Rishin | 4:0fde6ac73e8a | 43 | { |
| Rishin | 4:0fde6ac73e8a | 44 | TimerTimeCounterInit( ); |
| Rishin | 4:0fde6ac73e8a | 45 | } |
| Rishin | 4:0fde6ac73e8a | 46 | |
| Rishin | 4:0fde6ac73e8a | 47 | |
| Rishin | 4:0fde6ac73e8a | 48 | uint8_t BoardGetBatteryLevel( void ) |
| Rishin | 4:0fde6ac73e8a | 49 | { |
| Rishin | 4:0fde6ac73e8a | 50 | return 0xFE; |
| Rishin | 4:0fde6ac73e8a | 51 | } |
