
hello world
Dependencies: lib_gps lib_mpl3115a2 lmic_MOTE_L152RC mbed
Fork of lmic_NAmote_GPS by
Revision 2:a8f00db60fdb, committed 2015-07-02
- Comitter:
- dudmuck
- Date:
- Thu Jul 02 01:03:13 2015 +0000
- Parent:
- 1:c3b55f1c9f7a
- Child:
- 3:d81e4a63fb2e
- Commit message:
- support V3 mote board
Changed in this revision
lib_gps.lib | Show annotated file Show diff for this revision Revisions of this file |
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/lib_gps.lib Thu Jun 18 23:23:55 2015 +0000 +++ b/lib_gps.lib Thu Jul 02 01:03:13 2015 +0000 @@ -1,1 +1,1 @@ -https://developer.mbed.org/users/dudmuck/code/lib_gps/#b531881123bf +https://developer.mbed.org/users/dudmuck/code/lib_gps/#03d7275dc4fd
--- a/main.cpp Thu Jun 18 23:23:55 2015 +0000 +++ b/main.cpp Thu Jul 02 01:03:13 2015 +0000 @@ -18,9 +18,21 @@ #include "gps.h" #include "debug.h" + #define SENET_F //#define SMTC +typedef enum { + MOTE_NONE = 0, + MOTE_V2, + MOTE_V3 +} mote_version_e; +mote_version_e mote_version = MOTE_NONE; + +DigitalOut pc_7(PC_7); +DigitalIn pc_1(PC_1); + + /* ****************************************** */ /* ***** Basic App and Network Parameters *** */ /* ****************************************** */ @@ -113,6 +125,24 @@ ////////////////////////////////////////////////// // MAIN - INITIALIZATION AND STARTUP ////////////////////////////////////////////////// +void get_mote_version() +{ + char first; + + /*DigitalOut pc_7(PC_7); + DigitalIn pc_1(PC_1);*/ + + pc_7 = 1; + first = pc_1; + pc_7 = 0; + if (first && !pc_1) { + //printf("v2-mote\r\n"); + mote_version = MOTE_V2; + } else { + //printf("v3-mote\r\n"); + mote_version = MOTE_V3; + } +} // initial job static void initfunc (osjob_t* j) { @@ -130,6 +160,12 @@ // init done - onEvent() callback will be invoked... //DEBUG_STR("E: INITFUNC"); + get_mote_version(); + if (mote_version == MOTE_V3) + gps.en_invert = false; + else + gps.en_invert = true; + gps.init(); gps.enable(1); //gps.verbose = 1;