Skip to content

Instantly share code, notes, and snippets.

/*
* Project basic-spl-boron
* Description: CAN bus message receiver and battery discharge enable
* Author: Mark Amber
* Date: 2022.10.11
*/
#include "DebounceSwitchRK.h"
-- This will send schema
-- {"date": date, "starttime":time, "endtime":time, "length":mins}
-- to the server
rapidjson = require("rapidjson")
uselog = {}
t = session_start
uselog["startTime"] = {t.year, t.month, t.day, t.hour, t.min}
t= session_end
CN.Dev = {
qcmd_masterlev = {cmd = "\x00", returnlength = 1, storeloc = Controls.master_lev.Value, func = read_signed},
qcmd_sidetone = {cmd = "\x01", returnlength = 1, storeloc = Controls.sidetone_lev.Value, func = read_signed},
qcmd_reminput = {cmd = "\x02", returnlength = 1, storeloc = Controls.rem_in.Value, func = read_unsigned},
}
--In the table above I am attempting to store a reference to a control: storeloc = Controls.master_lev.Value.
--This way, later on when I get a random return value over UDP I match it up to the "cmd" field and then I know
--how long the data is "returnlength", where to put the data "storeloc", and what function to pass the data through
--to convert it into a format which the control value will like
.Reset -> debug mode...
*****************************
SKAARHOJ Controller Booting
*****************************
SK_VERSION: v2.4.12
_defConfigCsc=222
SK_MODEL: SK_QUICKBAR
SK_SERIAL: 434457
I2C 400 kHz mode activated
Init LEDs and buttons