Skip to content

Commit

Permalink
rpi-config: Add CAN0_INTERRUPT_PIN and CAN1_INTERRUPT_PIN variable
Browse files Browse the repository at this point in the history
Current configuration hard-code the values of the CAN interrupt pins. This setting allows to change them. The default values are the same as before.

Signed-off-by: Damiano Ferrari <[email protected]>
  • Loading branch information
dferrarigrowtech committed Jan 26, 2024
1 parent 8bad47e commit a93a444
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions recipes-bsp/bootfiles/rpi-config_git.bb
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ GPIO_IR ?= "18"
GPIO_IR_TX ?= "17"

CAN_OSCILLATOR ?= "16000000"
CAN0_INTERRUPT_PIN ?= "25"
CAN1_INTERRUPT_PIN ?= "24"

ENABLE_UART ??= ""

Expand Down Expand Up @@ -247,12 +249,12 @@ do_deploy() {
# ENABLE DUAL CAN
if [ "${ENABLE_DUAL_CAN}" = "1" ]; then
echo "# Enable DUAL CAN" >>$CONFIG
echo "dtoverlay=mcp2515-can0,oscillator=${CAN_OSCILLATOR},interrupt=25" >>$CONFIG
echo "dtoverlay=mcp2515-can1,oscillator=${CAN_OSCILLATOR},interrupt=24" >>$CONFIG
echo "dtoverlay=mcp2515-can0,oscillator=${CAN_OSCILLATOR},interrupt=${CAN0_INTERRUPT_PIN}" >>$CONFIG
echo "dtoverlay=mcp2515-can1,oscillator=${CAN_OSCILLATOR},interrupt=${CAN1_INTERRUPT_PIN}" >>$CONFIG
# ENABLE CAN
elif [ "${ENABLE_CAN}" = "1" ]; then
echo "# Enable CAN" >>$CONFIG
echo "dtoverlay=mcp2515-can0,oscillator=${CAN_OSCILLATOR},interrupt=25" >>$CONFIG
echo "dtoverlay=mcp2515-can0,oscillator=${CAN_OSCILLATOR},interrupt=${CAN0_INTERRUPT_PIN}" >>$CONFIG
fi


Expand Down

0 comments on commit a93a444

Please sign in to comment.