Добавлен модуль для мониторинга сети

This commit is contained in:
2025-11-13 09:38:31 +03:00
parent 3614e8f8c3
commit 75bed20511
15 changed files with 306 additions and 164 deletions

View File

@@ -15,6 +15,7 @@
#include "adc.h"
#include "upp_main.h"
#include "adc_tools.h"
#include "power_monitor.h"
// INCLUDES END
#endif //_APP_INCLUDES_H_

View File

@@ -32,15 +32,12 @@ void ThyristorWrite(real_T* Buffer)
*/
void app_readInputs(const real_T* Buffer) {
// USER APP INPUT START
ADC_Set_Channel_Value(ADC3, 4, ReadInputArray(0,0));
ADC_Set_Channel_Value(ADC3, 5, ReadInputArray(0,1));
ADC_Set_Channel_Value(ADC3, 6, ReadInputArray(0,2));
ADC_Set_Channel_Value(ADC3, 7, ReadInputArray(0,3));
ADC_Set_Channel_Value(ADC3, 8, ReadInputArray(0,4));
ADC_Set_Channel_Value(ADC3, 10, ReadInputArray(0,5));
__HAL_TIM_SET_AUTORELOAD(&adc_tim, ReadInputArray(1, 0));
ADC_Set_Channel_Value(ADC3, 4, ReadInputArray(0,0));
ADC_Set_Channel_Value(ADC3, 5, ReadInputArray(0,1));
ADC_Set_Channel_Value(ADC3, 6, ReadInputArray(0,2));
ADC_Set_Channel_Value(ADC3, 7, ReadInputArray(0,3));
ADC_Set_Channel_Value(ADC3, 8, ReadInputArray(0,4));
ADC_Set_Channel_Value(ADC3, 10, ReadInputArray(0,5));
// USER APP INPUT END
}
@@ -55,14 +52,14 @@ void app_writeOutputBuffer(real_T* Buffer) {
//ThyristorWrite(Buffer);
for (int i = 0; i < 2; i++)
{
WriteOutputArray(ZC_Detected[i], 0, i);
WriteOutputArray(pm.ZC_Detected[i], 0, i);
}
extern ADC_Periodic_t adc;
for(int i = 0; i < 6; i++)
{
WriteOutputArray(adc.Data[i], 1, i);
}
extern ADC_Periodic_t adc;
for(int i = 0; i < 6; i++)
{
WriteOutputArray(pm.adc.Data[i], 1, i);
}
// USER APP OUTPUT END
}