forked from commaai/panda
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of https://github.com/commaai/panda into alfa-r…
…omeo
- Loading branch information
Showing
111 changed files
with
8,591 additions
and
7,376 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,3 +29,7 @@ nosetests.xml | |
*.gcno | ||
tests/safety/coverage-out | ||
tests/safety/coverage.info | ||
|
||
*.profraw | ||
*.profdata | ||
mull.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#pragma once | ||
#include "can_declarations.h" | ||
|
||
static const uint8_t PANDA_CAN_CNT = 3U; | ||
static const uint8_t PANDA_BUS_CNT = 3U; | ||
|
||
static const unsigned char dlc_to_len[] = {0U, 1U, 2U, 3U, 4U, 5U, 6U, 7U, 8U, 12U, 16U, 20U, 24U, 32U, 48U, 64U}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#pragma once | ||
|
||
// ********************* Critical section helpers ********************* | ||
void enable_interrupts(void); | ||
void disable_interrupts(void); | ||
|
||
extern uint8_t global_critical_depth; | ||
|
||
#define ENTER_CRITICAL() \ | ||
__disable_irq(); \ | ||
global_critical_depth += 1U; | ||
|
||
#define EXIT_CRITICAL() \ | ||
global_critical_depth -= 1U; \ | ||
if ((global_critical_depth == 0U) && interrupts_enabled) { \ | ||
__enable_irq(); \ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#pragma once | ||
|
||
extern bool bootkick_reset_triggered; | ||
|
||
void bootkick_tick(bool ignition, bool recent_heartbeat); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#pragma once | ||
|
||
// IRQs: CAN1_TX, CAN1_RX0, CAN1_SCE | ||
// CAN2_TX, CAN2_RX0, CAN2_SCE | ||
// CAN3_TX, CAN3_RX0, CAN3_SCE | ||
|
||
#define CAN_ARRAY_SIZE 3 | ||
#define CAN_IRQS_ARRAY_SIZE 3 | ||
extern CAN_TypeDef *cans[CAN_ARRAY_SIZE]; | ||
extern uint8_t can_irq_number[CAN_IRQS_ARRAY_SIZE][CAN_IRQS_ARRAY_SIZE]; | ||
|
||
bool can_set_speed(uint8_t can_number); | ||
void can_clear_send(CAN_TypeDef *CANx, uint8_t can_number); | ||
void update_can_health_pkt(uint8_t can_number, uint32_t ir_reg); | ||
|
||
// ***************************** CAN ***************************** | ||
// CANx_TX IRQ Handler | ||
void process_can(uint8_t can_number); | ||
// CANx_RX0 IRQ Handler | ||
// blink blue when we are receiving CAN messages | ||
void can_rx(uint8_t can_number); | ||
bool can_init(uint8_t can_number); |
Oops, something went wrong.