SX1276Lib
Fork of SX1276Lib by
Revision 2:5eb3066446dd, committed 2014-08-19
- Comitter:
- GregCr
- Date:
- Tue Aug 19 08:50:09 2014 +0000
- Parent:
- 1:f979673946c0
- Child:
- 3:ca84be1f3fac
- Commit message:
- Corrections linked to the board detection and handling
Changed in this revision
--- a/enums/enums.h Tue Aug 19 07:10:31 2014 +0000 +++ b/enums/enums.h Tue Aug 19 08:50:09 2014 +0000 @@ -43,7 +43,14 @@ MODEM_LORA }; - +/*! + * Type of the supported board. [SX1276MB1MAS / SX1276MB1LAS] + */ +enum BoardType +{ + SX1276MB1MAS, + SX1276MB1LAS +}; /*! * Radio FSK modem parameters */
--- a/sx1276/sx1276-hal.cpp Tue Aug 19 07:10:31 2014 +0000 +++ b/sx1276/sx1276-hal.cpp Tue Aug 19 08:50:09 2014 +0000 @@ -99,18 +99,20 @@ //------------------------------------------------------------------------- // Board relative functions //------------------------------------------------------------------------- -void SX1276MB1xAS::DetectBoardType( void ) +uint8_t SX1276MB1xAS::DetectBoardType( void ) { antSwitch.input( ); if( antSwitch == 1 ) { - boardConnected = 0x01; + boardConnected = SX1276MB1LAS; } else { - boardConnected = 0x00; + boardConnected = SX1276MB1MAS; } antSwitch.output( ); + + return ( boardConnected ); } void SX1276MB1xAS::IoInit( void )
--- a/sx1276/sx1276-hal.h Tue Aug 19 07:10:31 2014 +0000 +++ b/sx1276/sx1276-hal.h Tue Aug 19 08:50:09 2014 +0000 @@ -42,12 +42,7 @@ virtual ~SX1276MB1xAS( ) { }; protected: - - /*! - * @brief Detect the board connected by reading the value of the antenna switch pin - */ - virtual void DetectBoardType( void ); - + /*! * @brief Initializes the radio I/Os pins interface */ @@ -115,6 +110,11 @@ public: /*! + * @brief Detect the board connected by reading the value of the antenna switch pin + */ + virtual uint8_t DetectBoardType( void ); + + /*! * @brief Checks if the given RF frequency is supported by the hardware * * @param [IN] frequency RF frequency to be checked