Skip to content
Snippets Groups Projects
Commit 7124cbf3 authored by Claudio Micheli's avatar Claudio Micheli Committed by Beat Küng
Browse files

Fixed CI broken build. Made TELEM2 default port.

Device port can be set via SENS_EN_CM8JL65 parameter:
SENS_EN_CM8JL65 = 0 -> Disabled
SENS_EN_CM8JL65 = 1 -> Enabled on TELEM2
SENS_EN_CM8JL65 = 2 -> Enabled on TELEM1

Signed-off-by: default avatarClaudio Micheli <claudio@auterion.com>
parent e4381bfc
No related branches found
No related tags found
No related merge requests found
......@@ -94,9 +94,16 @@ then
fi
# Lanbao PSK-CM8JL65-CC5 distance sensor
if param compare SENS_EN_CM8JL65 1
if param greater SENS_EN_CM8JL65 0
then
cm8jl65 start
if param compare SENS_EN_CM8JL65 1
then
cm8jl65 start
fi
if param compare SENS_EN_CM8JL65 2
then
cm8jl65 start -d "/dev/ttyS1"
fi
fi
......
......@@ -75,8 +75,8 @@
#define CM8JL65_TAKE_RANGE_REG 'd'
// designated serial port on Pixhawk (TELEM1)
#define CM8JL65_DEFAULT_PORT "/dev/ttyS1" // Its baudrate is 115200
// designated serial port on Pixhawk (TELEM2)
#define CM8JL65_DEFAULT_PORT "/dev/ttyS2" // Its baudrate is 115200
// normal conversion wait time
#define CM8JL65_CONVERSION_INTERVAL 50*1000UL/* 50ms */
......
......@@ -177,7 +177,7 @@ int cm8jl65_parser(uint8_t c, uint8_t *parserbuf, CM8JL65_PARSE_STATE *state, ui
if (c == (*crc16 & 0xFF)) {
// printf("Checksum verified \n");
*dist = (parserbuf[DISTANCE_MSB_POS] << 8) | parserbuf[DISTANCE_LSB_POS];
return OK;
return 0;
}
/*else {
//printf("Checksum invalidon low byte: 0x%02X, calculated: 0x%04X \n",c, *crc16);
......
......@@ -36,9 +36,10 @@
*
* @reboot_required true
* @min 0
* @max 1
* @max 2
* @group Sensors
* @value 0 Disabled
* @value 1 Enabled
* @value 1 Enabled on TELEM2
* @value 2 Enabled on TELEM1
*/
PARAM_DEFINE_INT32(SENS_EN_CM8JL65, 0);
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment