Skip to content

Commit

Permalink
Merge branch 'commaai:master' into ccnc-port
Browse files Browse the repository at this point in the history
  • Loading branch information
royjr authored Dec 14, 2024
2 parents 5350332 + 9272d4b commit 3bfdfc1
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 44 deletions.
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,13 @@ RUN pip3 install --break-system-packages --no-cache-dir $PYTHONPATH/panda/[dev]

# TODO: this should be a "pip install" or not even in this repo at all
RUN git config --global --add safe.directory $PYTHONPATH/panda
ENV OPENDBC_REF="e1ce3619a5db661ef2b406ccf258a253baf6eebc"
ENV OPENDBC_REF="b89fe79950121ca93d8a1f0d3fd17df31703be2a"
RUN cd /tmp/ && \
git clone --depth 1 https://github.com/commaai/opendbc opendbc_repo && \
cd opendbc_repo && git fetch origin $OPENDBC_REF && git checkout FETCH_HEAD && rm -rf .git/ && \
pip3 install --break-system-packages --no-cache-dir Cython numpy && \
scons -j8 --minimal opendbc/ && \
ln -s $PWD/opendbc $PYTHONPATH/opendbc
ln -s $PWD/opendbc $PYTHONPATH/opendbc && \
scons -j8 --minimal opendbc/

# for Jenkins
COPY README.md panda.tar.* /tmp/
Expand Down
10 changes: 1 addition & 9 deletions board/boards/cuatro.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,6 @@ static void cuatro_set_bootkick(BootState state) {
//set_gpio_output(GPIOC, 12, state != BOOT_RESET);
}

static void cuatro_set_siren(bool enabled){
beeper_enable(enabled);
}

static void cuatro_set_amp_enabled(bool enabled){
set_gpio_output(GPIOA, 5, enabled);
}
Expand Down Expand Up @@ -133,10 +129,6 @@ static void cuatro_init(void) {
// Clock source
clock_source_init();

// Beeper
set_gpio_alternate(GPIOD, 14, GPIO_AF2_TIM4);
beeper_init();

// Sound codec
cuatro_set_amp_enabled(false);
set_gpio_alternate(GPIOA, 2, GPIO_AF8_SAI4); // SAI4_SCK_B
Expand Down Expand Up @@ -170,7 +162,7 @@ board board_cuatro = {
.read_current_mA = cuatro_read_current_mA,
.set_fan_enabled = cuatro_set_fan_enabled,
.set_ir_power = unused_set_ir_power,
.set_siren = cuatro_set_siren,
.set_siren = unused_set_siren,
.set_bootkick = cuatro_set_bootkick,
.read_som_gpio = tres_read_som_gpio,
.set_amp_enabled = cuatro_set_amp_enabled
Expand Down
26 changes: 0 additions & 26 deletions board/drivers/beeper.h

This file was deleted.

2 changes: 1 addition & 1 deletion board/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ static void tick_handler(void) {
}

if (controls_allowed || heartbeat_engaged) {
controls_allowed_countdown = 30U;
controls_allowed_countdown = 5U;
} else if (controls_allowed_countdown > 0U) {
controls_allowed_countdown -= 1U;
} else {
Expand Down
13 changes: 11 additions & 2 deletions board/safety/safety_hyundai.h
Original file line number Diff line number Diff line change
Expand Up @@ -250,8 +250,17 @@ static int hyundai_fwd_hook(int bus_num, int addr) {
if (bus_num == 0) {
bus_fwd = 2;
}
if ((bus_num == 2) && (addr != 0x340) && (addr != 0x485)) {
bus_fwd = 0;

if (bus_num == 2) {
// Stock LKAS11 messages
bool is_lkas_11 = (addr == 0x340);
// LFA and HDA cluster icons
bool is_lfahda_mfc = (addr == 0x485);

bool block_msg = is_lkas_11 || is_lfahda_mfc;
if (!block_msg) {
bus_fwd = 0;
}
}

return bus_fwd;
Expand Down
1 change: 0 additions & 1 deletion board/stm32h7/board.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
#include "drivers/fan.h"
#include "stm32h7/llfan.h"
#include "stm32h7/lldac.h"
#include "drivers/beeper.h"
#include "drivers/fake_siren.h"
#include "stm32h7/sound.h"
#include "drivers/clock_source.h"
Expand Down
1 change: 0 additions & 1 deletion board/stm32h7/peripherals.h
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,6 @@ void peripherals_init(void) {
RCC->APB2ENR |= RCC_APB2ENR_TIM1EN; // clock source timer
RCC->APB1LENR |= RCC_APB1LENR_TIM2EN; // main counter
RCC->APB1LENR |= RCC_APB1LENR_TIM3EN; // fan pwm
RCC->APB1LENR |= RCC_APB1LENR_TIM4EN; // beeper source
RCC->APB1LENR |= RCC_APB1LENR_TIM6EN; // interrupt timer
RCC->APB1LENR |= RCC_APB1LENR_TIM7EN; // DMA trigger timer
RCC->APB2ENR |= RCC_APB2ENR_TIM8EN; // tick timer
Expand Down
2 changes: 1 addition & 1 deletion tests/misra/test_misra.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ cppcheck() {
--suppressions-list=$DIR/suppressions.txt --suppress=*:*inc/* \
--suppress=*:*include/* --error-exitcode=2 --check-level=exhaustive --safety \
--platform=arm32-wchar_t4 $COMMON_DEFINES --checkers-report=$CHECKLIST.tmp \
--std=c11 "$@" |& tee $OUTPUT
--std=c11 "$@" 2>&1 | tee $OUTPUT

cat $CHECKLIST.tmp >> $CHECKLIST
rm $CHECKLIST.tmp
Expand Down

0 comments on commit 3bfdfc1

Please sign in to comment.