safety param: assume uint16_t (#929)

This commit is contained in:
Shane Smiskol 2022-04-28 17:40:50 -07:00 committed by GitHub
parent d031d6e283
commit cf8fb0b883
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -40,8 +40,8 @@ AddrCheckStruct toyota_addr_checks[] = {
addr_checks toyota_rx_checks = {toyota_addr_checks, TOYOTA_ADDR_CHECKS_LEN};
// safety param flags
// first two bytes are for eps factor, last two are for flags
const uint32_t TOYOTA_PARAM_OFFSET = 16U;
// first byte is for eps factor, second is for flags
const uint32_t TOYOTA_PARAM_OFFSET = 8U;
const uint32_t TOYOTA_EPS_FACTOR = (1U << TOYOTA_PARAM_OFFSET) - 1U;
const uint32_t TOYOTA_ALT_BRAKE = 1U << TOYOTA_PARAM_OFFSET;

View File

@ -180,7 +180,7 @@ class Panda(object):
CLOCK_SOURCE_MODE_DISABLED = 0
CLOCK_SOURCE_MODE_FREE_RUNNING = 1
FLAG_TOYOTA_ALT_BRAKE = (1 << 16)
FLAG_TOYOTA_ALT_BRAKE = (1 << 8)
FLAG_HONDA_ALT_BRAKE = 1
FLAG_HONDA_BOSCH_LONG = 2