Skip to content

Commit

Permalink
refactor(device name): Changed device name to include chip id
Browse files Browse the repository at this point in the history
- Changed device name to include chip id
- refactoring of several variable names to improve readability

BREAKING CHANGE:
  • Loading branch information
renatobo committed Feb 25, 2021
1 parent 5a23536 commit 4b53cc3
Show file tree
Hide file tree
Showing 6 changed files with 153 additions and 102 deletions.
2 changes: 1 addition & 1 deletion build_hscrl.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ cat << EOF > $output
xsi:schemaLocation="http://www.gps-laptimer.de Scripts.xsd">
<author>Renato Bonomini</author>
<version>0.1</version>
<version>0.2</version>
<purpose>sensor.btle</purpose>
<replacing>false</replacing>
<script><![CDATA[
Expand Down
28 changes: 28 additions & 0 deletions include/canbusble_pinout.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/******************************************************************************
DucatiPanigaleCanBus: monitor CANBUS messages and report them to HLT
More info at https://github.com/renatobo/DucatiPanigaleCanBus
Renato Bonomini https://github.com/renatobo
******************************************************************************/

// Define PINS used for interfaces here

/* ------- Status LED --------- */
// Define LED_STATUS to the pin used to show status of the system:
// - 1 sec frequency on/off: regular activity
// - fading light: CAN connection error, waiting to retry
// Standard configuration: we flip status of LED_BUILTIN to show the main loop is active
// You can decide to have the
#ifdef ARDUINO_LOLIN_D32_PRO
#define LED_STATUS GPIO_NUM_5
#else
#define LED_STATUS GPIO_NUM_2
#endif

/* ------- CANBUS transceiver RX and TX pins --------- */
// You can use any PIN because
#define TX_GPIO_NUM GPIO_NUM_21
#define RX_GPIO_NUM GPIO_NUM_22

/* end of file */
4 changes: 2 additions & 2 deletions platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ monitor_port = /dev/cu.SLAB_USBtoUART
board = esp32doit-devkit-v1
build_flags =
-DCORE_DEBUG_LEVEL=4
-DCAN_SIMULATOR_MODE
-DCAN_DATA_SIMULATOR_MODE
monitor_port = /dev/cu.SLAB_USBtoUART

[env:lolin]
Expand All @@ -58,4 +58,4 @@ build_flags =
-DCORE_DEBUG_LEVEL=3
-DBOARD_HAS_PSRAM
-mfix-esp32-psram-cache-issue
-DCAN_SIMULATOR_MODE
-DCAN_DATA_SIMULATOR_MODE
8 changes: 4 additions & 4 deletions scripts/DucatiPanigaleCanbus.hscrl
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@
xsi:schemaLocation="http://www.gps-laptimer.de Scripts.xsd">

<author>Renato Bonomini</author>
<version>0.1</version>
<version>0.2</version>
<purpose>sensor.btle</purpose>
<replacing>false</replacing>
<script><![CDATA[
-- todo: add engine.wheelspeed
local errorMsg = false
local sensorname = "Ducati-Panigale"
local sensordevicepattern = "DuCan.."
local sensordevicepattern = "DuCan-...."
local bleservice = "6E400001-59f2-4a41-9acd-cd56fb435d64"
-- local blecharacteristicstatic = "6E400010-59f2-4a41-9acd-cd56fb435d64"
local blecharacteristicslow = "6E400011-59f2-4a41-9acd-cd56fb435d64"
Expand Down Expand Up @@ -149,7 +149,7 @@
sensor.queuechannelset(nil, engine)
end
--tracereturn(engine, "sensor.fastbytesread()")
end
end
function sensor.slowbytesread(message)
-- enginetemperature, ambientemperature, battery
Expand All @@ -162,7 +162,7 @@
if messagetype == 2 then
-- Create a new and empty set of channels
enginechannelset = {}
enginechannelset = {}
-- Parsing engine temp, byte 1
-- engine.enginetemp: coolant temperature; integer -40..215 degree Celsius; optional
-- Parsing environmental temp, byte 2
Expand Down
2 changes: 1 addition & 1 deletion src/DucatiPanigaleCanbus.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

local errorMsg = false
local sensorname = "Ducati-Panigale"
local sensordevicepattern = "DuCan.."
local sensordevicepattern = "DuCan-...."
local bleservice = "6E400001-59f2-4a41-9acd-cd56fb435d64"
-- local blecharacteristicstatic = "6E400010-59f2-4a41-9acd-cd56fb435d64"
local blecharacteristicslow = "6E400011-59f2-4a41-9acd-cd56fb435d64"
Expand Down
Loading

0 comments on commit 4b53cc3

Please sign in to comment.