Skip to content

Commit

Permalink
Remove abi example and add doc.
Browse files Browse the repository at this point in the history
  • Loading branch information
Fabien-B committed Feb 20, 2024
1 parent 2e9270a commit 3ccd186
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 25 deletions.
5 changes: 4 additions & 1 deletion conf/modules/lidar_vl53l5cx.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
<!DOCTYPE module SYSTEM "module.dtd">
<module name="lidar_vl53l5cx" dir="lidar" task="sensors">
<doc>
<description>VL53L5CX multizone range sensor.</description>
<description>
VL53L5CX multizone range sensor.
Sends LIDAR_DATA Abi messages.
</description>
<configure name="LIDAR_VL53L5CX_I2C_DEV" value="i2c2" description="I2C device to use for the VL53L5CX sensor"/>
<define name="LIDAR_VL53L5CX_I2C_ADDR" value="0x52" description="I2C address"/>
</doc>
Expand Down
24 changes: 0 additions & 24 deletions sw/airborne/arch/chibios/modules/lidar/lidar_vl53l5cx.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,6 @@
static IN_DMA_SECTION(VL53L5CX_Configuration vl53l5cx_dev);
static IN_DMA_SECTION(VL53L5CX_ResultsData vl53l5cx_results);

static abi_event lidar_ev;


static THD_WORKING_AREA(wa_thd_lidar_vl53l5cx, 1024);
static void thd_lidar_vl53l5cx(void *arg);

Expand All @@ -56,25 +53,6 @@ char *VL53L5CX_ERROR_MSGS[] = {
"VL53L5CX_RUNTIME_ERROR",
};

static void lidar_cb(uint8_t sender_id __attribute__((unused)),
uint32_t stamp __attribute__((unused)),
uint32_t numRows, uint32_t numCols, uint16_t size,
uint8_t subtype, uint8_t *data)
{
(void)numRows;
(void)numCols;
(void)size;
(void)subtype;
(void)data;
// example
// float f[16];
// uint16_t* distances_mm = (uint16_t*) data;
// for(int i=0; i<16; i++) {
// f[i] = distances_mm[i];
// }
// DOWNLINK_SEND_PAYLOAD_FLOAT(DefaultChannel, DefaultDevice, 16, f);
}


void lidar_vl53l5cx_init(void)
{
Expand All @@ -83,8 +61,6 @@ void lidar_vl53l5cx_init(void)
vl53l5cx_dev.platform.thread_handle = NULL;
vl53l5cx_dev.platform.error_code = VL53L5CX_NO_ERROR;

AbiBindMsgLIDAR_DATA(ABI_BROADCAST, &lidar_ev, lidar_cb);

// Create thread
vl53l5cx_dev.platform.thread_handle = chThdCreateStatic(wa_thd_lidar_vl53l5cx, sizeof(wa_thd_lidar_vl53l5cx),
NORMALPRIO, thd_lidar_vl53l5cx, (void *)&vl53l5cx_dev);
Expand Down

0 comments on commit 3ccd186

Please sign in to comment.