Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tuning update #26

Merged
merged 40 commits into from
Oct 30, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
0bc20ce
Merge pull request #16 from commaai/devel
pjlao307 Aug 22, 2017
5ba1590
Merge pull request #17 from commaai/devel
pjlao307 Sep 3, 2017
1837d98
Merge pull request #18 from commaai/devel
pjlao307 Oct 1, 2017
979e3a6
Merge pull request #19 from commaai/devel
pjlao307 Oct 1, 2017
2144207
Merge remote-tracking branch 'upstream/devel' into devel
joeylao Oct 9, 2018
730e6be
Merge remote-tracking branch 'upstream/devel' into devel
pjlao307 Oct 14, 2018
a76f62e
Add screen recording functionality - using engineering UI
pjlao307 Oct 15, 2018
b892e1c
Rename screencapture.h to dashcam.h; Add code to rotate captured vide…
pjlao307 Oct 15, 2018
364a505
Only kill screenrecord process if we're actually recording
pjlao307 Oct 15, 2018
0d88d70
Fix bug where stopping recording does not stop recording; Add check …
pjlao307 Oct 15, 2018
532ab9c
Make video directory into a variable
pjlao307 Oct 15, 2018
747b900
Change filenames to use date/time; change method from screen_capture(…
pjlao307 Oct 15, 2018
1cab5db
Use defined value instead of hard coded.
pjlao307 Oct 15, 2018
34467df
Add lock recording function
pjlao307 Oct 16, 2018
f96a1bf
Update dashcam.h
pjlao307 Oct 16, 2018
55982e3
Only show lock button when we're recording
pjlao307 Oct 16, 2018
34abe1e
Don't register taps on the lock button if it's not visible
pjlao307 Oct 16, 2018
7c75128
Update dashcam.h
pjlao307 Oct 16, 2018
399f046
Fix memory leak
pjlao307 Oct 17, 2018
9b94770
Change default to 3 min (max for screenrecord) and 10 files
pjlao307 Oct 17, 2018
689b00a
Fix layering issue with date/time
pjlao307 Oct 17, 2018
8b06b27
Merge BogGyver's ALCA code
pjlao307 Oct 20, 2018
b26abbb
Revert back to 3 min timer
pjlao307 Oct 20, 2018
1e22e4d
Update loader image
pjlao307 Oct 20, 2018
b8774fa
Move dashcam call so it renders the buttons
pjlao307 Oct 20, 2018
c9fa92b
remove badly named file (#404)
rbiasini Oct 23, 2018
1951399
Update Genesis fingerprint for longer version from Saeed (#406)
James-T1 Oct 24, 2018
3d05cca
GM: disengage on radar fault (#396)
vntarasov Oct 24, 2018
f278acf
Merge remote-tracking branch 'upstream/devel' into devel
pjlao307 Oct 24, 2018
02ea097
Merge branch 'dashcam-alca' into devel
pjlao307 Oct 26, 2018
5501541
Improve Toyota radar filtering (#409)
pd0wm Oct 26, 2018
86da051
Merge remote-tracking branch 'upstream/devel' into devel
pjlao307 Oct 28, 2018
f7c53db
Initial commit for tuning mod
pjlao307 Oct 28, 2018
adb6b66
Add info like changelog to the file
pjlao307 Oct 28, 2018
e7dfb93
Add discription file for tuning mod
pjlao307 Oct 28, 2018
5488a19
Update TUNING.md
pjlao307 Oct 28, 2018
69963fa
Update TUNING.md
pjlao307 Oct 28, 2018
aaac63e
Update TUNING.md
pjlao307 Oct 28, 2018
0a54734
Update TUNING.md
pjlao307 Oct 28, 2018
17f549b
Update TUNING.md
pjlao307 Oct 28, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions TUNING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
Welcome to openpilot - Tuning mod
======

This openpilot mod allows you to dynamically modify variables used by openpilot.
The purpose of this mod is to make it easier to tweak certain variables instead of
having to modify code, recompile, reboot after every change.

To use this mod you need to do 2 things:

1. Create a file called **/sdcard/tuning/params.txt** on your EON.

You will need to specify which variables you want the Tuning mod to manage by adding them to that file. See the file called **selfdrive/ui/params.example.txt** for an example.

2. Modify OpenPilot code that uses the variable so that it is read from this file instead of hard coded. This is left for the user to figure out and implement.

This mod can manage up to 10 different variables with each variable having a maximum of 3 element values in it.

For questions or info about this mod, visit the comma slack channel #mod-tuning

To change the "scale" of the steps tap the "Steps" box. It will cycle through different scales. The step scales are: \[0.001, 0.01, 0.1, 1, 5\]

![screenshot](https://i.imgur.com/G7j2vQY.jpg)

CHANGE LOG:

v0.0.1 - Initial version

To Do:
- [ ] Ability to handle hex values
10 changes: 5 additions & 5 deletions cereal/Makefile
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
PWD := $(shell pwd)

SRCS := log.capnp car.capnp
SRCS := log.capnp car.capnp ui.capnp

GENS := gen/cpp/car.capnp.c++ gen/cpp/log.capnp.c++
JS := gen/js/car.capnp.js gen/js/log.capnp.js
GENS := gen/cpp/car.capnp.c++ gen/cpp/log.capnp.c++ gen/cpp/ui.capnp.c++
JS := gen/js/car.capnp.js gen/js/log.capnp.js gen/js/ui.capnp.js

UNAME_M ?= $(shell uname -m)

# only generate C++ for docker tests
ifneq ($(OPTEST),1)
GENS += gen/c/car.capnp.c gen/c/log.capnp.c gen/c/include/c++.capnp.h gen/c/include/java.capnp.h
GENS += gen/c/car.capnp.c gen/c/log.capnp.c gen/c/ui.capnp.c gen/c/include/c++.capnp.h gen/c/include/java.capnp.h

ifeq ($(UNAME_M),x86_64)
GENS += gen/java/Car.java gen/java/Log.java
GENS += gen/java/Car.java gen/java/Log.java gen/java/Ui.java
endif

endif
Expand Down
1 change: 1 addition & 0 deletions cereal/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@

log = capnp.load(os.path.join(CEREAL_PATH, "log.capnp"))
car = capnp.load(os.path.join(CEREAL_PATH, "car.capnp"))
ui = capnp.load(os.path.join(CEREAL_PATH, "ui.capnp"))
64 changes: 64 additions & 0 deletions cereal/ui.capnp
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
using Cxx = import "./include/c++.capnp";
$Cxx.namespace("cereal");

using Java = import "./include/java.capnp";
$Java.package("ai.comma.openpilot.cereal");
$Java.outerClassname("Ui");

using Car = import "car.capnp";

@0xce6ca45dddcd5317;

struct UIButtonInfo {
# button ID 0..5
btnId @0 :Int8;
# internal button name
btnName @1 :Text;
# display label for button (3 chars)
btnLabel @2 :Text;
# buttons status: 0 = DISABLED, 1 = AVAILABLE, 2 = ENABLED, 3 = WARNING, 9 = NOT AVAILABLE
btnStatus @3 :Int16;
# small font label shows below the main label, max 7 chars
btnLabel2 @4 :Text;
}

struct UIButtonStatus {
# button ID 0..5
btnId @0 :Int8;
# buttons status: 0 = DISABLED, 1 = AVAILABLE, 2 = ENABLED, 3 = WARNING, 9 = NOT AVAILABLE
btnStatus @1 :Int16;
}

struct UICustomAlert {
caStatus @0 :Int8;
caText @1 :Text;
}

struct UISetCar {
icCarFolder @0 :Text;
icCarName @1 :Text;
}

struct UIPlaySound {
sndSound @0 :Int8;
}

struct UIUpdate {
uiDoUpdate @0 :Int8;
uiStatus @1 :Int8;
uiCanDisplayMessage @2 :Int8;
}

#struct UIEvent {
# # in nanoseconds?
# logMonoTime @0 :UInt64;
#
# union {
# uiButtonInfo @1 :UIButtonInfo;
# uiCustomAlert @2 :UICustomAlert;
# uiSetCar @3 :UISetCar;
# uiButtonStatus @4 :UIButtonStatus;
# uiUpdate @5 :UIUpdate;
# uiPlaySound @6 :UIPlaySound;
# }
#}
2 changes: 1 addition & 1 deletion common/fingerprints.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,4 @@ def eliminate_incompatible_cars(msg, candidate_cars):

def all_known_cars():
"""Returns a list of all known car strings."""
return _FINGERPRINTS.keys()
return _FINGERPRINTS.keys()
2 changes: 1 addition & 1 deletion common/params.py
Original file line number Diff line number Diff line change
Expand Up @@ -355,4 +355,4 @@ def put(self, key, dat):

# Test multiprocess:
# seq 0 100000 | xargs -P20 -I{} python common/params.py DongleId {} && sleep 0.05
# while python common/params.py DongleId; do sleep 0.05; done
# while python common/params.py DongleId; do sleep 0.05; done
6 changes: 4 additions & 2 deletions common/transformations/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,10 @@ def get_model_height_transform(camera_frame_from_road_frame, height):
[0, 0, 1],
]))

road_high_from_camera_frame = np.linalg.inv(camera_frame_from_road_high)
high_camera_from_low_camera = np.dot(camera_frame_from_road_ground, road_high_from_camera_frame)
ground_from_camera_frame = np.linalg.inv(camera_frame_from_road_ground)

low_camera_from_high_camera = np.dot(camera_frame_from_road_high, ground_from_camera_frame)
high_camera_from_low_camera = np.linalg.inv(low_camera_from_high_camera)

return high_camera_from_low_camera

Expand Down
33 changes: 31 additions & 2 deletions opendbc/gm_global_a_object.dbc
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,37 @@ BO_ 776 ASCMAccSpeedStatus: 7 NEO
SG_ VehicleSpeed : 15|12@0+ (1,0) [0|0] "" B233B_LRR
SG_ AlwaysOne : 3|1@0+ (1,0) [0|0] "" B233B_LRR

BO_ 1120 LRRNumObjects: 8 B233B_LRR
SG_ LRRNumObjects : 20|5@0+ (1,0) [0|0] "" NEO
BO_ 1120 F_LRR_Obj_Header: 8 LRR_FO
SG_ FLRRRollingCount : 7|2@0+ (1,0) [0|3] "" EOCM_F_FO
SG_ FLRRModeCmdFdbk : 23|3@0+ (1,0) [0|7] "" EOCM_F_FO
SG_ FLRRNumValidTargets : 20|5@0+ (1,0) [0|31] "" EOCM_F_FO
SG_ FLRRTimeStampV : 31|1@0+ (1,0) [0|1] "" EOCM_F_FO
SG_ FLRRTimeStamp : 2|11@0+ (1,0) [0|2047] "ms" EOCM_F_FO
SG_ FLRRRoadTypeInfo : 5|3@0+ (1,0) [0|7] "" EOCM_F_FO
SG_ FLRRBurstChecksum : 55|16@0+ (1,0) [0|65535] "" EOCM_F_FO
SG_ FLRRDiagSpare : 30|1@0+ (1,0) [0|1] "" EOCM_F_FO
SG_ FLRRVltgOutRngLo : 44|1@0+ (1,0) [0|1] "" EOCM_F_FO
SG_ FLRRVltgOutRngHi : 43|1@0+ (1,0) [0|1] "" EOCM_F_FO
SG_ FLRRSvcAlgnInPrcs : 38|1@0+ (1,0) [0|1] "" EOCM_F_FO
SG_ FLRRSnsrBlckd : 45|1@0+ (1,0) [0|1] "" EOCM_F_FO
SG_ FLRRSnstvFltPrsntInt : 24|1@0+ (1,0) [0|1] "" EOCM_F_FO
SG_ FLRRPlntAlgnInProc : 37|1@0+ (1,0) [0|1] "" EOCM_F_FO
SG_ FLRRMsalgnYawRt : 47|1@0+ (1,0) [0|1] "" EOCM_F_FO
SG_ FLRRMsalgnYawLt : 46|1@0+ (1,0) [0|1] "" EOCM_F_FO
SG_ FLRRLonVelPlsblityFlt : 35|1@0+ (1,0) [0|1] "" EOCM_F_FO
SG_ FLRRYawRtPlsblityFlt : 34|1@0+ (1,0) [0|1] "" EOCM_F_FO
SG_ FLRRMsalgnPtchUp : 32|1@0+ (1,0) [0|1] "" EOCM_F_FO
SG_ FLRRMsalgnPtchDn : 33|1@0+ (1,0) [0|1] "" EOCM_F_FO
SG_ FLRRInitDiagCmplt : 40|1@0+ (1,0) [0|1] "" EOCM_F_FO
SG_ FLRRHWFltPrsntInt : 25|1@0+ (1,0) [0|1] "" EOCM_F_FO
SG_ FLRRExtIntrfrnc : 36|1@0+ (1,0) [0|1] "" EOCM_F_FO
SG_ FLRRCANSgnlSpvFld : 29|1@0+ (1,0) [0|1] "" EOCM_F_FO
SG_ FLRRCANRxErr : 28|1@0+ (1,0) [0|1] "" EOCM_F_FO
SG_ FLRRTunlDtctd : 27|1@0+ (1,0) [0|1] "" EOCM_F_FO
SG_ FLRRAmbTmpOutRngLw : 42|1@0+ (1,0) [0|1] "" EOCM_F_FO
SG_ FLRRAmbTmpOutRngHi : 41|1@0+ (1,0) [0|1] "" EOCM_F_FO
SG_ FLRRAntTngFltPrsnt : 26|1@0+ (1,0) [0|1] "" EOCM_F_FO
SG_ FLRRAlgnFltPrsnt : 39|1@0+ (1,0) [0|1] "" EOCM_F_FO

BO_ 1134 LRRObject14: 8 B233B_LRR
SG_ TrkRange : 5|11@0+ (0.125,0) [0|255.875] "m" NEO
Expand Down
43 changes: 31 additions & 12 deletions opendbc/tesla_can.dbc
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,8 @@ BO_ 3 STW_ANGL_STAT: 8 STW
SG_ MC_STW_ANGL_STAT : 55|4@0+ (1,0) [0|15] "" NEO
SG_ CRC_STW_ANGL_STAT : 63|8@0+ (1,0) [0|255] "" NEO

BO_ 14 STW_ANGLHP_STAT: 8 STW
BO_ 14 STW_ANGLHP_STAT: 8 STW

SG_ StW_AnglHP : 5|14@0+ (0.1,-819.2) [-819.2|819] "deg" NEO
SG_ StW_AnglHP_Spd : 21|14@0+ (0.5,-4096) [-4096|4095.5] "deg/s" NEO
SG_ StW_AnglHP_Sens_Stat : 33|2@0+ (1,0) [0|0] "" NEO
Expand Down Expand Up @@ -147,19 +148,21 @@ BO_ 309 ESP_135h: 5 ESP
SG_ ESP_espOffLamp : 31|1@0+ (1,0) [-1|2] "" NEO
SG_ ESP_stabilityControlSts : 14|3@0+ (1,0) [6|7] "" NEO
SG_ ESP_tcLampFlash : 5|1@0+ (1,0) [-1|2] "" NEO
SG_ ESP_tcOffLamp : 15|1@0+ (1,0) [0|1] "" NEOBO_ 341 ESP_B: 8 ESP
SG_ ESP_BChecksum : 39|8@0+ (1,0) [0|255] "" NEO,EPAS
SG_ ESP_BCounter : 62|4@0+ (1,0) [1|15] "" NEO,EPAS
SG_ ESP_vehicleSpeed : 47|16@0+ (0.00999999978,0) [0|0] "kph" NEO,EPAS
SG_ ESP_vehicleSpeedQF : 57|2@0+ (1,0) [1|2] "" NEO,EPAS
SG_ ESP_wheelPulseCountFrL : 7|8@0+ (1,0) [0|254] "" NEO,EPAS
SG_ ESP_wheelPulseCountFrR : 15|8@0+ (1,0) [0|254] "" NEO,EPAS
SG_ ESP_wheelPulseCountReL : 23|8@0+ (1,0) [0|254] "" NEO,EPAS
SG_ ESP_tcOffLamp : 15|1@0+ (1,0) [0|1] "" NEO

BO_ 341 ESP_B: 8 ESP
SG_ ESP_BChecksum : 39|8@0+ (1,0) [0|255] "" NEO,EPAS
SG_ ESP_BCounter : 62|4@0+ (1,0) [1|15] "" NEO,EPAS
SG_ ESP_vehicleSpeed : 47|16@0+ (0.00999999978,0) [0|0] "kph" NEO,EPAS
SG_ ESP_vehicleSpeedQF : 57|2@0+ (1,0) [1|2] "" NEO,EPAS
SG_ ESP_wheelPulseCountFrL : 7|8@0+ (1,0) [0|254] "" NEO,EPAS
SG_ ESP_wheelPulseCountFrR : 15|8@0+ (1,0) [0|254] "" NEO,EPAS
SG_ ESP_wheelPulseCountReL : 23|8@0+ (1,0) [0|254] "" NEO,EPAS
SG_ ESP_wheelPulseCountReR : 31|8@0+ (1,0) [0|254] "" NEO,EPAS

BO_ 532 EPB_epasControl: 3 EPB
SG_ EPB_epasControlChecksum : 23|8@0+ (1,0) [0|255] "" NEO,EPAS
SG_ EPB_epasControlCounter : 11|4@0+ (1,0) [0|15] "" NEO,EPAS
BO_ 532 EPB_epasControl: 3 EPB
SG_ EPB_epasControlChecksum : 23|8@0+ (1,0) [0|255] "" NEO,EPAS
SG_ EPB_epasControlCounter : 11|4@0+ (1,0) [0|15] "" NEO,EPAS
SG_ EPB_epasEACAllow : 2|3@0+ (1,0) [4|7] "" NEO,EPAS

BO_ 792 GTW_carState: 8 GTW
Expand Down Expand Up @@ -307,6 +310,21 @@ BO_ 840 GTW_status: 8 GTW
SG_ GTW_statusChecksum : 63|8@0+ (1,0) [0|255] "" NEO
SG_ GTW_statusCounter : 51|4@0+ (1,0) [0|15] "" NEO

BO_ 1361 GAS_COMMAND: 6 EON
SG_ GAS_COMMAND : 7|16@0+ (0.0507968128,-22.85856576) [0|1] "" INTERCEPTOR
SG_ GAS_COMMAND2 : 23|16@0+ (0.1015936256,-22.85856576) [0|1] "" INTERCEPTOR
SG_ ENABLE : 39|1@0+ (1,0) [0|1] "" INTERCEPTOR
SG_ IDX : 35|4@0+ (1,0) [0|15] "" INTERCEPTOR
SG_ CHECKSUM : 47|8@0+ (1,0) [0|3] "" INTERCEPTOR

BO_ 1362 GAS_SENSOR: 6 INTERCEPTOR
SG_ INTERCEPTOR_GAS : 7|16@0+ (0.0507968128,-22.85856576) [0|1] "" EON
SG_ INTERCEPTOR_GAS2 : 23|16@0+ (0.1015936256,-22.85856576) [0|1] "" EON
SG_ STATE : 35|4@0+ (1,0) [0|15] "" EON
SG_ IDX : 39|4@0+ (1,0) [0|15] "" EON
SG_ CHECKSUM : 47|8@0+ (1,0) [0|3] "" EON


VAL_ 3 StW_Angl 16383 "SNA" ;
VAL_ 3 StW_AnglSens_Id 2 "MUST" 0 "PSBL" 1 "SELF" ;
VAL_ 3 StW_AnglSens_Stat 2 "ERR" 3 "ERR_INI" 1 "INI" 0 "OK" ;
Expand Down Expand Up @@ -417,5 +435,6 @@ VAL_ 904 MCU_clusterReadyForDrive 0 "NO_SNA" 1 "YES" ;
VAL_ 1160 DAS_steeringAngleRequest 16384 "ZERO_ANGLE" ;
VAL_ 1160 DAS_steeringControlType 1 "ANGLE_CONTROL" 3 "DISABLED" 0 "NONE" 2 "RESERVED" ;
VAL_ 1160 DAS_steeringHapticRequest 1 "ACTIVE" 0 "IDLE" ;
VAL_ 1362 STATE 5 "FAULT_TIMEOUT" 4 "FAULT_STARTUP" 3 "FAULT_SCE" 2 "FAULT_SEND" 1 "FAULT_BAD_CHECKSUM" 0 "NO_FAULT" ;

CM_ "CHFFR_METRIC 1160 DAS_steeringAngleRequest STEER_ANGLE 0.1098666 180; CHFFR_METRIC 264 DI_motorRPM ENGINE_RPM 1 0";
11 changes: 10 additions & 1 deletion panda/board/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
// ********************* includes *********************

#include "libc.h"
#include "safety.h"
#include "provision.h"

#include "drivers/drivers.h"
Expand All @@ -19,6 +18,7 @@
#include "drivers/can.h"
#include "drivers/spi.h"
#include "drivers/timer.h"
#include "safety.h"


// ***************************** fan *****************************
Expand Down Expand Up @@ -291,6 +291,15 @@ int usb_cb_control_msg(USB_Setup_TypeDef *setup, uint8_t *resp, int hardwired) {
can_silent = ALL_CAN_BUT_MAIN_SILENT;
can_autobaud_enabled[0] = false;
break;
case SAFETY_TESLA:
can_silent = ALL_CAN_LIVE;
can_autobaud_enabled[0] = false;
can_autobaud_enabled[1] = false;
#ifdef PANDA
can_autobaud_enabled[2] = false;
#endif
// MISSING: setup GMLAN pin as output and high level to switch EPAS CAN on Tesla Giraffe
break;
default:
can_silent = ALL_CAN_LIVE;
can_autobaud_enabled[0] = false;
Expand Down
1 change: 1 addition & 0 deletions panda/board/pedal.honda/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
obj/*
59 changes: 59 additions & 0 deletions panda/board/pedal.honda/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# :set noet
PROJ_NAME = comma

CFLAGS = -O2 -Wall -std=gnu11 -DPEDAL
CFLAGS += -mlittle-endian -mthumb -mcpu=cortex-m3
CFLAGS += -msoft-float -DSTM32F2 -DSTM32F205xx
CFLAGS += -I ../inc -I ../ -I ../../ -nostdlib
CFLAGS += -T../stm32_flash.ld

STARTUP_FILE = startup_stm32f205xx

CC = arm-none-eabi-gcc
OBJCOPY = arm-none-eabi-objcopy
OBJDUMP = arm-none-eabi-objdump
DFU_UTIL = "dfu-util"

# pedal only uses the debug cert
CERT = ../../certs/debug
CFLAGS += "-DALLOW_DEBUG"

canflash: obj/$(PROJ_NAME).bin
../../tests/pedal/enter_canloader.py $<

usbflash: obj/$(PROJ_NAME).bin
../../tests/pedal/enter_canloader.py; sleep 0.5
PYTHONPATH=../../ python -c "from python import Panda; p = [x for x in [Panda(x) for x in Panda.list()] if x.bootstub]; assert(len(p)==1); p[0].flash('obj/$(PROJ_NAME).bin', reconnect=False)"

recover: obj/bootstub.bin obj/$(PROJ_NAME).bin
../../tests/pedal/enter_canloader.py --recover; sleep 0.5
$(DFU_UTIL) -d 0483:df11 -a 0 -s 0x08004000 -D obj/$(PROJ_NAME).bin
$(DFU_UTIL) -d 0483:df11 -a 0 -s 0x08000000:leave -D obj/bootstub.bin

obj/main.o: main.c ../*.h
mkdir -p obj
$(CC) $(CFLAGS) -o $@ -c $<

obj/bootstub.o: ../bootstub.c ../*.h
mkdir -p obj
$(CC) $(CFLAGS) -o $@ -c $<

obj/$(STARTUP_FILE).o: ../$(STARTUP_FILE).s
$(CC) $(CFLAGS) -o $@ -c $<

obj/%.o: ../../crypto/%.c
$(CC) $(CFLAGS) -o $@ -c $<

obj/$(PROJ_NAME).bin: obj/$(STARTUP_FILE).o obj/main.o
# hack
$(CC) -Wl,--section-start,.isr_vector=0x8004000 $(CFLAGS) -o obj/$(PROJ_NAME).elf $^
$(OBJCOPY) -v -O binary obj/$(PROJ_NAME).elf obj/code.bin
SETLEN=1 ../../crypto/sign.py obj/code.bin $@ $(CERT)

obj/bootstub.bin: obj/$(STARTUP_FILE).o obj/bootstub.o obj/sha.o obj/rsa.o
$(CC) $(CFLAGS) -o obj/bootstub.$(PROJ_NAME).elf $^
$(OBJCOPY) -v -O binary obj/bootstub.$(PROJ_NAME).elf $@

clean:
rm -f obj/*

28 changes: 28 additions & 0 deletions panda/board/pedal.honda/README
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
This is the firmware for the comma pedal. It borrows a lot from panda.

The comma pedal is a gas pedal interceptor for Honda/Acura. It allows you to "virtually" press the pedal.

This is the open source software. Note that it is not ready to use yet.

== Test Plan ==

* Startup
** Confirm STATE_FAULT_STARTUP
* Timeout
** Send value
** Confirm value is output
** Stop sending messages
** Confirm value is passthru after 100ms
** Confirm STATE_FAULT_TIMEOUT
* Random values
** Send random 6 byte messages
** Confirm random values cause passthru
** Confirm STATE_FAULT_BAD_CHECKSUM
* Same message lockout
** Send same message repeated
** Confirm timeout behavior
* Don't set enable
** Confirm no output
* Set enable and values
** Confirm output

Loading