-
Notifications
You must be signed in to change notification settings - Fork 4
Firmware structure
File bcomp.h
:
-
VIRTUINO_SUPPORT
- set to 1, for supporting Virtuino communication. -
INSIDE_VERSION
- set to 1, for setting inside version. -
PAJERO_SPECIFIC
- set to 1, for include specific functions for Mitsubishi Pajero Sport. -
NISSAN_SPECIFIC
- set to 1, for include specific functions for Nissan (CVT-transmission reading). -
GRAPH_SUPPORT
- set to 0, for disable OLED-screen support (only elog or Virtuino output data). -
ELOG_SUPPORT
- set to 1, for sending data to uart-logger device. Unsupport this option withVIRTUINO_SUPPORT
. -
WARNING_SUPPORT
- set to 1, for supporting warnings (beep sygnals and show messages, ifGRATH_SUPPORT
). -
NMEA_SUPPORT
- set to 1, for minimal supporting NMEA protocol (decode RMC messages). -
BUTTONS_ANALOG
- support analog (resistive matrix) buttons. -
OLED_SSD1306_SUPPORT
- support OLED 128x64 screen on SSD1306. -
OLED_SH1106_SUPPORT
- support OLED 128x64 screen on SH1106. -
WHELLS_DRAW_SUPPORT
- support wheels screen.
File dbg.h
:
-
_DBGOUT
- define it for debug outputs viaDBG()
function to UART.
File event.h
:
-
MAX_EVENT
- maximum count of events process. -
EVENT_64BIT
- set to 1, for 64-bit ms count. It need, for corect work, if MCU will be work more 40 days without resets. -
EVENTS_FREQ
- count of callsSysTick_Handler()
per second.
File buttons.h
-
BUTTONS_ANALOG
- support analog (resistive matrix) buttons. -
BUTTONS_SUPPORT_LONG
- support long-time button press. For using only one button.
This module realize transport for SAE J1979 and requests list of PIDs description in pids_list[]
structure.
This file consist PIDs defines, include vendor specific PIDs.
Asynchronous functions:
-
bcomp_proc()
calls fromobd.c
and decode necessary PID answers. -
bcomp_raw()
calls fromobd.c
and decode RAW data from CAN bus. This function vendor specific (now decode data for Mitsubishi Pajero Sport II). -
bcomp_calc()
call every 1 second for calculation and integration various parameters (distantions, fuel, trips, motohours). -
bcomp_analog()
call every 3 second for reading analog inputs. Now it read in Mitsubishi Pajero Sport II: external temperature, fuel level, onboard voltage. -
bcomp_save()
call every 30 second for saving parameters to external EEPROM. -
bcomp_elog()
call every 1 second, it setup flag for sending status to UART viaelog.c
module.
File bcomp.h
contain key defines for configuration project and main structure defines, as bcomp_t
with all parameters and calculations and bconfig_t
this standart configuration (warning levels, OLED and EEPROM type, default settings for warning levels and etc.).
This module implements protocol with Virtuino
This module monitoring parameters and warning events, if parameters go over allowed values.
Logging module for transmit some parameters to UART. External device for saving it some as: UART Logger or OpenLog Blackbox.
Output format is CSV.
time;speed;rpm;trans;batt;fuel;dfuel;lon;lat;gtime;gdate;t_eng;t_akpp;t_ext;p_fu
1406835930;0;0;D2;0.0;71.91;0.00;W10035.9989;N3051.8007;19-45-30;31-07-2014;65535;65535;9;0;0;0;0;0;
1406835931;0;0;D2;0.0;71.91;0.00;W10035.9989;N3051.8007;19-45-31;31-07-2014;65535;65535;9;0;0;0;0;0;
etc...
The first string consist description of columns, the next strings sens every second and consist actual data.
Configuration menu file. It config some parameters of BCOMP firmware in graphical menu on OLED-display. List of available parameters desctiption on menu[]
list.
Module of buttons support. Support analog and digital buttons.
Minimal support of NMEA protocol (GPS-receivers). It decode only RMC message. Function nmea_proc()
calls from uart.c
module for every receiving byte.
Module for asynchronous function calls. It based on SysTick timer. Support up to MAX_EVENT
functions simultaneously.