Skip to content

Instantly share code, notes, and snippets.

View celeron55's full-sized avatar

celeron55 celeron55

View GitHub Profile
Command: mode start
Mode set to: Start
Inverter 12V switch ON
CAN: ERROR: CAN_SR_SERR
Inverter CAN connection detected
StartState: Inverter became online at 160 ms
StartState: Enabling sending of CAN messages
StartState: Inverter reports initial voltage at 180 ms: 0.50 V
StartState: Starting precharge
Inverter precharge ON
@celeron55
celeron55 / gist:f9336ff382b7dd06e017e3ba4451f492
Last active December 20, 2017 00:37
Inverter controller output
Inverter CAN connection lost
Command: status
Status:
* connected: NO (no valid frames received)
* timed send: DISABLED
* mode: Off
* measured voltage: 40.00 V
Command: mode start
Mode set to: Start
Inverter 12V switch ON
static void crc_add_bit(uint16_t &crc, uint8_t bit)
{
crc <<= 1;
if(crc & 0x8000){
if(!bit)
crc ^= 0x4599;
} else {
if(bit)
crc ^= 0x4599;
}
static uint16_t crc_add_bits(uint16_t crc, uint16_t value, int num_bits)
{
uint16_t mask = 1<<(num_bits-1);
while(mask){
int bit = (value & mask) ? 1 : 0;
if(crc & 0x4000)
bit = !bit;
crc <<= 1;
if(bit)
crc ^= 0x4599;
static uint16_t crc_add_bits(uint16_t crc, uint16_t value, int num_bits)
{
uint16_t mask = 1<<(num_bits-1);
while(mask){
int bit = (value & mask) ? 1 : 0;
if(crc & 0x4000)
bit = !bit;
crc <<= 1;
if(bit)
crc ^= 0x4599;
@celeron55
celeron55 / gist:a951799517850dfec9a793b5247fa046
Created December 18, 2017 18:18
libsigrokdecode can crc last-bit-stuffing patch
diff --git a/decoders/can/pd.py b/decoders/can/pd.py
index 5be3e99..72fb505 100644
--- a/decoders/can/pd.py
+++ b/decoders/can/pd.py
@@ -129,7 +129,7 @@ def is_stuff_bit(self):
# CAN uses NRZ encoding and bit stuffing.
# After 5 identical bits, a stuff bit of opposite value is added.
# But not in the CRC delimiter, ACK, and end of frame fields.
- if len(self.bits) > self.last_databit + 16:
+ if len(self.bits) > self.last_databit + 17:
PRESS RELEASE 2017-09-13:
Minetest 0.5 has begun development!
===================================
The open source modding and community focused multiplayer block sandbox
engine Minetest (https://minetest.net) has merged the first big changes in
its 0.5-dev branch on GitHub (https://github.com/minetest/minetest).
Breaking changes include a move from the C++03 language standard to full
; z80dasm 1.1.3
; command line: z80dasm -l -a -g 0h original_rom.bin
; Peripheral mappings
; YM3514
ym3514_addr: equ 0e000h
; YM2142
ym2142_addr: equ 0e030h
; ROM mappings
I think I won't be using IRCCloud for one simple reason:
No matter how many web interfaces and mobile clients you provide, I
still need an IRC bouncer for my existing set-up, which I have tuned
over the years to suit my needs very well.
So my option would now be to be connected with two separete nicks, one
for the existing setup and one for IRCCloud. It would be confusing,
would also be considered nick spam on some channels and people
[package]
name = "cavity_assist"
version = "0.1.0"
authors = ["celeron55@iki.fi"]
publish = false
build = "build.rs"
[dependencies]
sdl2 = "0.18"
sdl2_ttf = "0.16"