forked from DotBots/DotBot-firmware
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
DotBots#292 LH_LOC: add sample project to segger
- Loading branch information
1 parent
1e47adf
commit ce8c361
Showing
4 changed files
with
99 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
/** | ||
* @file | ||
* @ingroup samples_drv | ||
* @author Said Alvarado-Marin <[email protected]> | ||
* @brief This is a short example of how to calculate the position of the DotBot using the 1LH_2D algorithm. | ||
* | ||
* | ||
* @date 2024 | ||
* | ||
* @copyright Inria, 2024 | ||
* | ||
*/ | ||
#include <nrf.h> | ||
#include <stdio.h> | ||
#include <stdlib.h> | ||
#include "board.h" | ||
#include "board_config.h" | ||
#include "lh2.h" | ||
#include "lh_location.h" | ||
|
||
//=========================== defines ========================================== | ||
|
||
//=========================== variables ======================================== | ||
|
||
static db_lh2_t _lh2; | ||
|
||
//=========================== main ============================================= | ||
|
||
/** | ||
* @brief The program starts executing here. | ||
*/ | ||
int main(void) { | ||
// Initialize the board core features (voltage regulator) | ||
db_board_init(); | ||
|
||
// Initialize the LH2 | ||
db_lh2_init(&_lh2, &db_lh2_d, &db_lh2_e); | ||
db_lh2_start(); | ||
|
||
while (1) { | ||
// wait until something happens e.g. an SPI interrupt | ||
__WFE(); | ||
|
||
// the location function has to be running all the time | ||
db_lh2_process_location(&_lh2); | ||
} | ||
|
||
// one last instruction, doesn't do anything, it's just to have a place to put a breakpoint. | ||
__NOP(); | ||
} |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters