f1_rev and threads (#173)

* f1_rev3: high speed (strenght) for heater PWM output

* threads: set name for all thread

* f1_dual: enalbe CH_CFG_USE_REGISTRY so GDB can see thread

* f1_rev3: enalbe CH_CFG_USE_REGISTRY so GDB can see thread
This commit is contained in:
Andrey G 2022-12-13 06:29:32 +03:00 committed by GitHub
parent 1e3a227f50
commit 1aa7c661f6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 17 additions and 3 deletions

View File

@ -151,6 +151,8 @@ void AuxOutThread(void*)
{ {
const auto cfg = GetConfiguration(); const auto cfg = GetConfiguration();
chRegSetThreadName("Aux out");
while(1) while(1)
{ {
for (int ch = 0; ch < AFR_CHANNELS; ch++) for (int ch = 0; ch < AFR_CHANNELS; ch++)

View File

@ -183,7 +183,7 @@ typedef int pid_t;
* @note The default is @p TRUE. * @note The default is @p TRUE.
*/ */
#if !defined(CH_CFG_USE_REGISTRY) #if !defined(CH_CFG_USE_REGISTRY)
#define CH_CFG_USE_REGISTRY FALSE #define CH_CFG_USE_REGISTRY TRUE
#endif #endif
/** /**

View File

@ -109,7 +109,7 @@
* PB12 - Nernsr_4.2_esr_drive (digital input, no pull) - keep high-Z after power on * PB12 - Nernsr_4.2_esr_drive (digital input, no pull) - keep high-Z after power on
* PB13..PB15 - unused * PB13..PB15 - unused
*/ */
#define VAL_GPIOBCRL 0x8A888200 /* PB7...PB0 */ #define VAL_GPIOBCRL 0x8B888200 /* PB7...PB0 */
#define VAL_GPIOBCRH 0x88843488 /* PB15...PB8 */ #define VAL_GPIOBCRH 0x88843488 /* PB15...PB8 */
#define VAL_GPIOBODR 0x0000FFFF #define VAL_GPIOBODR 0x0000FFFF

View File

@ -183,7 +183,7 @@ typedef int pid_t;
* @note The default is @p TRUE. * @note The default is @p TRUE.
*/ */
#if !defined(CH_CFG_USE_REGISTRY) #if !defined(CH_CFG_USE_REGISTRY)
#define CH_CFG_USE_REGISTRY FALSE #define CH_CFG_USE_REGISTRY TRUE
#endif #endif
/** /**

View File

@ -17,6 +17,8 @@ static Configuration* configuration;
static THD_WORKING_AREA(waCanTxThread, 256); static THD_WORKING_AREA(waCanTxThread, 256);
void CanTxThread(void*) void CanTxThread(void*)
{ {
chRegSetThreadName("CAN Tx");
while(1) while(1)
{ {
SendRusefiFormat(configuration->CanIndexOffset); SendRusefiFormat(configuration->CanIndexOffset);
@ -45,6 +47,8 @@ static float remoteBatteryVoltage = 0;
static THD_WORKING_AREA(waCanRxThread, 512); static THD_WORKING_AREA(waCanRxThread, 512);
void CanRxThread(void*) void CanRxThread(void*)
{ {
chRegSetThreadName("CAN Rx");
while(1) while(1)
{ {
CANRxFrame frame; CANRxFrame frame;

View File

@ -196,6 +196,8 @@ static void HeaterThread(void*)
{ {
int ch; int ch;
chRegSetThreadName("Heater");
// Wait for temperature sensing to stabilize so we don't // Wait for temperature sensing to stabilize so we don't
// immediately think we overshot the target temperature // immediately think we overshot the target temperature
chThdSleepMilliseconds(1000); chThdSleepMilliseconds(1000);

View File

@ -26,6 +26,8 @@ static struct pump_control_state state[AFR_CHANNELS] =
static THD_WORKING_AREA(waPumpThread, 256); static THD_WORKING_AREA(waPumpThread, 256);
static void PumpThread(void*) static void PumpThread(void*)
{ {
chRegSetThreadName("Pump");
while(true) while(true)
{ {
for (int ch = 0; ch < AFR_CHANNELS; ch++) for (int ch = 0; ch < AFR_CHANNELS; ch++)

View File

@ -37,6 +37,8 @@ static void SamplingThread(void*)
float r_2[AFR_CHANNELS] = {0}; float r_2[AFR_CHANNELS] = {0};
float r_3[AFR_CHANNELS] = {0}; float r_3[AFR_CHANNELS] = {0};
chRegSetThreadName("Sampling");
/* GD32: Insert 20us delay after ADC enable */ /* GD32: Insert 20us delay after ADC enable */
chThdSleepMilliseconds(1); chThdSleepMilliseconds(1);

View File

@ -28,6 +28,8 @@ static char printBuffer[200];
static THD_WORKING_AREA(waUartThread, 512); static THD_WORKING_AREA(waUartThread, 512);
static void UartThread(void*) static void UartThread(void*)
{ {
chRegSetThreadName("UART debug");
// in UART_DEBUG mode we only support Serial - this file name here has a bit of a confusing naming // in UART_DEBUG mode we only support Serial - this file name here has a bit of a confusing naming
sdStart(&SD1, &cfg); sdStart(&SD1, &cfg);