only:nastyornot
This commit is contained in:
Andrey 2024-06-17 17:57:29 -04:00 committed by rusefillc
parent 2e5828b665
commit e927de593e
5 changed files with 69 additions and 10 deletions

View File

@ -140,7 +140,13 @@ static const struct mc33810_config mc33810 = {
.spi_bus = &SPID3,
.spi_config = {
.circular = false,
#ifdef _CHIBIOS_RT_CONF_VER_6_1_
.end_cb = NULL,
#else
.slave = false,
.data_cb = NULL,
.error_cb = NULL,
#endif
// SPI3_CS_33810 OUT_PWM1 H144_OUT_PWM1
.ssport = GPIOD,
.sspad = 13,

View File

@ -230,7 +230,13 @@ static const struct mc33810_config mc33810_odd = {
.spi_bus = &SPID5,
.spi_config = {
.circular = false,
#ifdef _CHIBIOS_RT_CONF_VER_6_1_
.end_cb = NULL,
#else
.slave = false,
.data_cb = NULL,
.error_cb = NULL,
#endif
.ssport = GPIOF,
.sspad = 1,
.cr1 =
@ -269,7 +275,13 @@ static const struct mc33810_config mc33810_even = {
.spi_bus = &SPID5,
.spi_config = {
.circular = false,
.end_cb = NULL,
#ifdef _CHIBIOS_RT_CONF_VER_6_1_
.end_cb = NULL,
#else
.slave = false,
.data_cb = NULL,
.error_cb = NULL,
#endif
.ssport = GPIOF,
.sspad = 2,
.cr1 =

View File

@ -24,8 +24,15 @@
#include "mpu_util.h"
#include "ignition_controller.h"
static SPIConfig spiCfg = { .circular = false,
.end_cb = NULL,
static SPIConfig spiCfg = {
.circular = false,
#ifdef _CHIBIOS_RT_CONF_VER_6_1_
.end_cb = NULL,
#else
.slave = false,
.data_cb = NULL,
.error_cb = NULL,
#endif
.ssport = NULL,
.sspad = 0,
.cr1 =

View File

@ -52,7 +52,13 @@ struct tle6240_config tle6240 = {
.spi_bus = NULL,
.spi_config = {
.circular = false,
.end_cb = NULL,
#ifdef _CHIBIOS_RT_CONF_VER_6_1_
.end_cb = NULL,
#else
.slave = false,
.data_cb = NULL,
.error_cb = NULL,
#endif
.ssport = NULL,
.sspad = 0,
.cr1 =
@ -80,7 +86,13 @@ struct mc33972_config mc33972 = {
.spi_bus = NULL,
.spi_config = {
.circular = false,
.end_cb = NULL,
#ifdef _CHIBIOS_RT_CONF_VER_6_1_
.end_cb = NULL,
#else
.slave = false,
.data_cb = NULL,
.error_cb = NULL,
#endif
.ssport = NULL,
.sspad = 0,
.cr1 =
@ -104,7 +116,13 @@ struct l9779_config l9779_cfg = {
.spi_bus = NULL,
.spi_config = {
.circular = false,
.end_cb = NULL,
#ifdef _CHIBIOS_RT_CONF_VER_6_1_
.end_cb = NULL,
#else
.slave = false,
.data_cb = NULL,
.error_cb = NULL,
#endif
.ssport = NULL,
.sspad = 0,
.cr1 =
@ -144,7 +162,13 @@ struct tle8888_config tle8888_cfg = {
.spi_bus = NULL,
.spi_config = {
.circular = false,
.end_cb = NULL,
#ifdef _CHIBIOS_RT_CONF_VER_6_1_
.end_cb = NULL,
#else
.slave = false,
.data_cb = NULL,
.error_cb = NULL,
#endif
.ssport = NULL,
.sspad = 0,
.cr1 =
@ -200,7 +224,13 @@ struct drv8860_config drv8860 = {
.spi_bus = NULL,
.spi_config = {
.circular = false,
.end_cb = NULL,
#ifdef _CHIBIOS_RT_CONF_VER_6_1_
.end_cb = NULL,
#else
.slave = false,
.data_cb = NULL,
.error_cb = NULL,
#endif
.ssport = NULL,
.sspad = 0,
.cr1 =

View File

@ -14,12 +14,16 @@
#include "histogram.h"
#ifdef _CHIBIOS_RT_CONF_VER_6_1_
#define ch0 ch
#endif
/**
* Unfortunately ChibiOS has two versions of methods for different
* contexts.
*/
#define isLocked() (ch.dbg.lock_cnt > 0)
#define isIsrContext() (ch.dbg.isr_cnt > 0)
#define isLocked() (ch0.dbg.lock_cnt > 0)
#define isIsrContext() (ch0.dbg.isr_cnt > 0)
#define assertIsrContext(code) efiAssertVoid(code, isIsrContext(), "NOT_ISR")