Обновление
This commit is contained in:
parent
b388a07264
commit
a38dfabd7e
|
|
@ -23,6 +23,10 @@ void Mma_Init(
|
|||
env->thread.id = 0;
|
||||
}
|
||||
|
||||
#include "ADC_Temp_KST45-14-2.h"
|
||||
|
||||
const char LOG_TASK_ARB[] = "Arb";
|
||||
|
||||
static _Noreturn void Mma_Thread(tMma *env) {
|
||||
|
||||
// Запуск устройства
|
||||
|
|
@ -31,11 +35,21 @@ static _Noreturn void Mma_Thread(tMma *env) {
|
|||
can_rx_message_type frame_data;
|
||||
|
||||
uint32_t step = 0;
|
||||
int16_t temp = 0;
|
||||
|
||||
for (;;) {
|
||||
|
||||
SystemDelayMs(1000);
|
||||
|
||||
if (osMutexAcquire(env->adcTask0.access, 1000) == osOK) {
|
||||
temp = get_temperature_fast_KST45(env->adcTask0.ADC_Data[0]);
|
||||
osMutexRelease(env->adcTask0.access);
|
||||
}
|
||||
|
||||
LoggerFormatInfo(&env->slog.logger, LOG_TASK_ARB, "Temp = %d", temp)
|
||||
|
||||
// ADC_Start(ADC_INSTANCE_0);
|
||||
|
||||
/*
|
||||
if (osMutexAcquire(env->linTaskActuator0.access, 5000) == osOK) {
|
||||
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@
|
|||
#include "CanSpamTransmitter.h"
|
||||
#include "Lins.h"
|
||||
#include "LinTasks.h"
|
||||
#include "AdcTasks.h"
|
||||
|
||||
|
||||
|
||||
|
|
@ -53,6 +54,9 @@ typedef struct {
|
|||
|
||||
tLinTaskActuator linTaskActuator0;
|
||||
|
||||
tAdcTask adcTask0;
|
||||
tAdcTask adcTask1;
|
||||
|
||||
struct {
|
||||
osThreadId_t id;
|
||||
uint32_t stack[1024 * 1];
|
||||
|
|
@ -60,9 +64,6 @@ typedef struct {
|
|||
osThreadAttr_t attr;
|
||||
} thread;
|
||||
|
||||
uint8_t data[46];
|
||||
|
||||
uint8_t BufFileWrite[512];
|
||||
} tMma;
|
||||
|
||||
void Mma_Init(
|
||||
|
|
|
|||
|
|
@ -80,10 +80,14 @@ static void Mma_InitSubSystems(tMma *env) {
|
|||
*/
|
||||
|
||||
tLinData *linData = Lin0_Init(GetLin0CallbackHandler);
|
||||
|
||||
Lin_0_Init(&env->linTaskActuator0, linData, &env->linPorts->lin0_Io);
|
||||
Lin0_StartThread(&env->linTaskActuator0);
|
||||
|
||||
Li0_StartThread(&env->linTaskActuator0);
|
||||
Adc_0_Init(&env->adcTask0, &env->adcs->adc_0_IO);
|
||||
Adc_0_StartThread(&env->adcTask0);
|
||||
|
||||
Adc_1_Init(&env->adcTask1, &env->adcs->adc_1_IO);
|
||||
Adc_1_StartThread(&env->adcTask1);
|
||||
|
||||
|
||||
LoggerInfoStatic(&env->slog.logger, LOG_TASK_MAIN, "End of subsystem initialization")
|
||||
|
|
|
|||
|
|
@ -4,12 +4,21 @@
|
|||
|
||||
#include "PeripheralInterfaces.h"
|
||||
|
||||
const DMA_InitType dmaInitCfg =
|
||||
{
|
||||
.eArbitrationAlgorithm = DMA_ARBITRATION_ALGORITHM_FIXED_PRIORITY,
|
||||
.bHaltOnError = false
|
||||
};
|
||||
|
||||
void InitPeripheralInterfaces() {
|
||||
// Gpios_Init();
|
||||
// Adcs_Init();
|
||||
Gpios_Init();
|
||||
|
||||
DMA_Init(DMA_INSTANCE_0, &dmaInitCfg);
|
||||
|
||||
SerialPorts_Init();
|
||||
CanPorts_Init();
|
||||
|
||||
Adcs_Init();
|
||||
Rtcs_Init();
|
||||
// StorageOnFlash_Init();
|
||||
// Pwms_Init();
|
||||
|
|
|
|||
Loading…
Reference in New Issue