adc+tim+dma采集有问题
This commit is contained in:
parent
c5ed140daf
commit
ea6d12ca11
|
@ -69,8 +69,9 @@
|
|||
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/Peripheral/inc}""/>
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/mppt_Nos_V0.4/App/inc}""/>
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/mppt_Nos_V0.4/Hardware/inc}""/>
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/mppt_Nos_V0.4/Drivers/RingQueue}""/>
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/mppt_Nos_V0.4/Drivers/TimeSliceOffset}""/>
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/mppt_Nos_V0.4/Drivers/RingQueue}""/>
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/mppt_Nos_V0.4/Drivers/RingQueue2}""/>
|
||||
</option>
|
||||
<option id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.compiler.std.2020844713" name="Language standard" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.compiler.std" useByScannerDiscovery="true" value="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.compiler.std.gnu99" valueType="enumerated"/>
|
||||
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="true" id="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.compiler.defs.177116515" name="Defined symbols (-D)" superClass="ilg.gnumcueclipse.managedbuild.cross.riscv.option.c.compiler.defs" useByScannerDiscovery="true" valueType="definedSymbols"/>
|
||||
|
@ -123,9 +124,10 @@
|
|||
</toolChain>
|
||||
</folderInfo>
|
||||
<sourceEntries>
|
||||
<entry excluding="Startup|Peripheral|Ld|Debug|Core" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name=""/>
|
||||
<entry excluding="Drivers|Startup|Peripheral|Ld|Debug|Core" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name=""/>
|
||||
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="Core"/>
|
||||
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="Debug"/>
|
||||
<entry flags="VALUE_WORKSPACE_PATH" kind="sourcePath" name="Drivers"/>
|
||||
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="Ld"/>
|
||||
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="Peripheral"/>
|
||||
<entry excluding="startup_ch32v20x_D8.S|startup_ch32v20x_D8W.S" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="Startup"/>
|
||||
|
@ -150,4 +152,5 @@
|
|||
</storageModule>
|
||||
<storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders"/>
|
||||
<storageModule moduleId="org.eclipse.cdt.make.core.buildtargets"/>
|
||||
<storageModule moduleId="refreshScope"/>
|
||||
</cproject>
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/>
|
||||
<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
|
||||
<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
|
||||
<provider class="org.eclipse.cdt.managedbuilder.language.settings.providers.GCCBuiltinSpecsDetector" console="false" env-hash="998107432084761222" id="ilg.gnumcueclipse.managedbuild.cross.riscv.GCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT RISC-V Cross GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} ${cross_toolchain_flags} -E -P -v -dD "${INPUTS}"" prefer-non-shared="true">
|
||||
<provider class="org.eclipse.cdt.managedbuilder.language.settings.providers.GCCBuiltinSpecsDetector" console="false" env-hash="1033085767641952736" id="ilg.gnumcueclipse.managedbuild.cross.riscv.GCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT RISC-V Cross GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} ${cross_toolchain_flags} -E -P -v -dD "${INPUTS}"" prefer-non-shared="true">
|
||||
<language-scope id="org.eclipse.cdt.core.gcc"/>
|
||||
<language-scope id="org.eclipse.cdt.core.g++"/>
|
||||
</provider>
|
||||
|
|
|
@ -17,6 +17,6 @@ float get_DSG_CURR(void);
|
|||
float get_PV_VOLT_IN(void);
|
||||
float get_SYS_VOLT_IN(void);
|
||||
float get_MOSFET_Temper(void);
|
||||
float get_PV2_VOLT_IN(void);
|
||||
//float get_PV2_VOLT_IN(void);
|
||||
|
||||
#endif /* APP_INC_COLLECT_CONVERSION_H_ */
|
||||
|
|
|
@ -141,6 +141,7 @@ static uint16_t get_adc(uint8_t ADC_Channel);
|
|||
static uint16_t get_aftercalculationAdc(uint8_t ADC_Channel);
|
||||
static uint16_t middleAverageFilter(uint8_t ADC_Channel);
|
||||
static uint16_t get_adcDmaTim_middleAverageFilter(uint8_t ADC_Channel);
|
||||
static uint16_t Get_ConversionVal(int16_t val);
|
||||
|
||||
/**
|
||||
* @brief »ñÈ¡¼ÆËãºóµÄadcµÄÖµ
|
||||
|
@ -169,58 +170,68 @@ uint16_t get_aftercalculationAdc1(uint8_t ADC_Channel)
|
|||
*/
|
||||
uint16_t get_adcDmaTim_middleAverageFilter(uint8_t ADC_Channel)
|
||||
{
|
||||
uint16_t i,j,k;
|
||||
uint16_t temp,sum = 0;
|
||||
uint16_t value_buf[g_adcData.num];
|
||||
|
||||
if (ADC_Channel == CHG_CURR) {
|
||||
for(i = 0; i < g_adcData.num; ++i) {
|
||||
value_buf[i] = g_adcData.CHG_CURR_array[i];
|
||||
}
|
||||
// } else if (ADC_Channel == PV_VOLT_OUT) {
|
||||
// for(i = 0; i < g_adcData.num; ++i) {
|
||||
// value_buf[i] = g_adcData.PV_VOLT_OUT_array[i];
|
||||
// }
|
||||
} else if (ADC_Channel == DSG_CURR) {
|
||||
for(i = 0; i < g_adcData.num; ++i) {
|
||||
value_buf[i] = g_adcData.DSG_CURR_array[i];
|
||||
}
|
||||
// } else if (ADC_Channel == PV_VOLT_IN) {
|
||||
// for(i = 0; i < g_adcData.num; ++i) {
|
||||
// value_buf[i] = g_adcData.PV_VOLT_IN_array[i];
|
||||
// }
|
||||
// } else if (ADC_Channel == SYS_VOLT_IN) {
|
||||
// for(i = 0; i < g_adcData.num; ++i) {
|
||||
// value_buf[i] = g_adcData.SYS_VOLT_IN_array[i];
|
||||
// }
|
||||
// } else if (ADC_Channel == MOSFET_Temper) {
|
||||
// for(i = 0; i < g_adcData.num; ++i) {
|
||||
// value_buf[i] = g_adcData.MOSFET_Temper_array[i];
|
||||
// }
|
||||
} else {
|
||||
return 0;
|
||||
return Get_ConversionVal(g_adcData.total_CHG_CURR / adcBuffSize);
|
||||
}
|
||||
|
||||
/*从小到大冒泡排序*/
|
||||
for(j = 0; j < g_adcData.num-1; ++j)
|
||||
{
|
||||
for(k = 0; k < g_adcData.num-j-1; ++k)
|
||||
{
|
||||
if(value_buf[k] > value_buf[k+1])
|
||||
{
|
||||
temp = value_buf[k];
|
||||
value_buf[k] = value_buf[k+1];
|
||||
value_buf[k+1] = temp;
|
||||
}
|
||||
}
|
||||
if (ADC_Channel == DSG_CURR) {
|
||||
return Get_ConversionVal(g_adcData.total_DSG_CURR / adcBuffSize);
|
||||
}
|
||||
|
||||
for(i = 2; i < g_adcData.num - 2; ++i)
|
||||
{
|
||||
sum += value_buf[i];
|
||||
}
|
||||
return 0;
|
||||
|
||||
return sum / (g_adcData.num - 4);
|
||||
// uint16_t i,j,k;
|
||||
// uint16_t temp,sum = 0;
|
||||
// uint16_t value_buf[g_adcData.num];
|
||||
//
|
||||
// if (ADC_Channel == CHG_CURR) {
|
||||
// for(i = 0; i < g_adcData.num; ++i) {
|
||||
// value_buf[i] = g_adcData.CHG_CURR_array[i];
|
||||
// }
|
||||
//// } else if (ADC_Channel == PV_VOLT_OUT) {
|
||||
//// for(i = 0; i < g_adcData.num; ++i) {
|
||||
//// value_buf[i] = g_adcData.PV_VOLT_OUT_array[i];
|
||||
//// }
|
||||
// } else if (ADC_Channel == DSG_CURR) {
|
||||
// for(i = 0; i < g_adcData.num; ++i) {
|
||||
// value_buf[i] = g_adcData.DSG_CURR_array[i];
|
||||
// }
|
||||
//// } else if (ADC_Channel == PV_VOLT_IN) {
|
||||
//// for(i = 0; i < g_adcData.num; ++i) {
|
||||
//// value_buf[i] = g_adcData.PV_VOLT_IN_array[i];
|
||||
//// }
|
||||
//// } else if (ADC_Channel == SYS_VOLT_IN) {
|
||||
//// for(i = 0; i < g_adcData.num; ++i) {
|
||||
//// value_buf[i] = g_adcData.SYS_VOLT_IN_array[i];
|
||||
//// }
|
||||
//// } else if (ADC_Channel == MOSFET_Temper) {
|
||||
//// for(i = 0; i < g_adcData.num; ++i) {
|
||||
//// value_buf[i] = g_adcData.MOSFET_Temper_array[i];
|
||||
//// }
|
||||
// } else {
|
||||
// return 0;
|
||||
// }
|
||||
//
|
||||
// /*从小到大冒泡排序*/
|
||||
// for(j = 0; j < g_adcData.num-1; ++j)
|
||||
// {
|
||||
// for(k = 0; k < g_adcData.num-j-1; ++k)
|
||||
// {
|
||||
// if(value_buf[k] > value_buf[k+1])
|
||||
// {
|
||||
// temp = value_buf[k];
|
||||
// value_buf[k] = value_buf[k+1];
|
||||
// value_buf[k+1] = temp;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// for(i = 2; i < g_adcData.num - 2; ++i)
|
||||
// {
|
||||
// sum += value_buf[i];
|
||||
// }
|
||||
//
|
||||
// return sum / (g_adcData.num - 4);
|
||||
}
|
||||
|
||||
|
||||
|
@ -302,6 +313,7 @@ float get_CHG_CURR(void)
|
|||
|
||||
// I_ADC = Get_ConversionVal(get_adc(CHG_CURR));
|
||||
I_ADC = get_aftercalculationAdc(CHG_CURR);
|
||||
|
||||
// I_ADC = g_adcData.total_CHG_CURR / g_adcData.num;
|
||||
// I_ADC = get_adc(CHG_CURR);
|
||||
|
||||
|
@ -328,8 +340,8 @@ float get_PV_VOLT_OUT(void)
|
|||
uint16_t V_ADC;
|
||||
|
||||
// V_ADC = Get_ConversionVal(get_adc(PV_VOLT_OUT));
|
||||
// V_ADC = get_aftercalculationAdc1(PV_VOLT_OUT);
|
||||
V_ADC = get_aftercalculationAdc(PV_VOLT_OUT);
|
||||
V_ADC = get_aftercalculationAdc1(PV_VOLT_OUT);
|
||||
// V_ADC = get_aftercalculationAdc(PV_VOLT_OUT);
|
||||
// V_ADC = g_adcData.total_PV_VOLT_OUT / g_adcData.num;
|
||||
// V_ADC = get_adc(PV_VOLT_OUT);
|
||||
|
||||
|
@ -477,31 +489,31 @@ float get_MOSFET_Temper(void)
|
|||
return T;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 得到光伏2开路电压
|
||||
* @param
|
||||
* @retval V 电压值
|
||||
*/
|
||||
float get_PV2_VOLT_IN(void)
|
||||
{
|
||||
float V;
|
||||
uint16_t V_ADC;
|
||||
|
||||
// GPIO_WriteBit(G_FFMOS_CON2_GPIO, G_FFMOS_CON2_PIN, SET);
|
||||
// V_ADC = Get_ConversionVal(get_adc(PV2_VOLT_IN));
|
||||
V_ADC = get_aftercalculationAdc(PV2_VOLT_IN);
|
||||
// V_ADC = get_adc(PV2_VOLT_IN);
|
||||
// GPIO_WriteBit(G_FFMOS_CON2_GPIO, G_FFMOS_CON2_PIN, RESET);
|
||||
|
||||
V = (float)(V_ADC) * P_PV2_VOLT_IN;
|
||||
|
||||
#ifdef enable_Printf_VI
|
||||
printf("\n PV2_VOLT_IN ADC : %d \n", V_ADC);
|
||||
printf(" PV2_VOLT_IN V : %d /100 \n", (int)(V * 100));
|
||||
#endif
|
||||
|
||||
return V;
|
||||
}
|
||||
///**
|
||||
// * @brief 得到光伏2开路电压
|
||||
// * @param
|
||||
// * @retval V 电压值
|
||||
// */
|
||||
//float get_PV2_VOLT_IN(void)
|
||||
//{
|
||||
// float V;
|
||||
// uint16_t V_ADC;
|
||||
//
|
||||
//// GPIO_WriteBit(G_FFMOS_CON2_GPIO, G_FFMOS_CON2_PIN, SET);
|
||||
//// V_ADC = Get_ConversionVal(get_adc(PV2_VOLT_IN));
|
||||
//// V_ADC = get_aftercalculationAdc(PV2_VOLT_IN);
|
||||
//// V_ADC = get_adc(PV2_VOLT_IN);
|
||||
//// GPIO_WriteBit(G_FFMOS_CON2_GPIO, G_FFMOS_CON2_PIN, RESET);
|
||||
//
|
||||
// V = (float)(V_ADC) * P_PV2_VOLT_IN;
|
||||
//
|
||||
//#ifdef enable_Printf_VI
|
||||
// printf("\n PV2_VOLT_IN ADC : %d \n", V_ADC);
|
||||
// printf(" PV2_VOLT_IN V : %d /100 \n", (int)(V * 100));
|
||||
//#endif
|
||||
//
|
||||
// return V;
|
||||
//}
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -822,7 +822,7 @@ void test(void)
|
|||
// printf("Discharg_Current = %d/1000 \n", (int)(g_Mppt_Para.Discharg_Current * 1000));
|
||||
// printf("\n\n\n");
|
||||
|
||||
printf("%d\n", g_adcData.num);
|
||||
// printf("%d\n", g_adcData.num);
|
||||
printf("%d\n", (int)(g_Mppt_Para.Charg_Current * 1000));
|
||||
printf("%d\n", (int)(g_Mppt_Para.Output_Voltage * 1000));
|
||||
printf("%d\r\n", (int)(g_Mppt_Para.Discharg_Current * 1000));
|
||||
|
@ -831,7 +831,7 @@ void test(void)
|
|||
// printf("get_PV_VOLT_IN1 = %d/1000 \n", (int)(get_PV_VOLT_IN1() * 1000));
|
||||
// printf("HighSideMos_Temperature = %d/1000 \n", (int)(g_Mppt_Para.HighSideMos_Temperature * 1000));
|
||||
|
||||
g_adcData.num = 0;
|
||||
// g_adcData.num = 0;
|
||||
|
||||
//// mppt_readjust();
|
||||
//// Get_OutputPower();
|
||||
|
|
|
@ -816,9 +816,6 @@ void task_Init(void)
|
|||
// TimeSliceOffset_Register(&m_startMpptControl, Task_startMpptControl
|
||||
// , startMpptControl_reloadVal, startMpptControl_offset);
|
||||
|
||||
|
||||
ADC_TIM_DMA_Init();
|
||||
|
||||
TimeSliceOffset_Start(); /* 启动时间片轮询 */
|
||||
}
|
||||
|
||||
|
@ -841,14 +838,15 @@ void hardware_Init(void)
|
|||
POW_OUT_CON_Init();
|
||||
DSG_PROT_Init();
|
||||
WORK_VOLT_INT_Init();
|
||||
ADC_TIM_DMA_Init();
|
||||
// EnPowerSupply_Init();
|
||||
|
||||
// Set_duty_ratio(&g_duty_ratio);
|
||||
|
||||
// uart_dev_write(g_bat485_uart3_handle, " hello world \n", sizeof(" hello world \n"));
|
||||
|
||||
// TIM3_Init(10000);
|
||||
// TIM_Cmd(TIM3, ENABLE); //TIM3使能
|
||||
TIM3_Init(300);
|
||||
TIM_Cmd(TIM3, ENABLE); //TIM3使能
|
||||
|
||||
g_duty_ratio = 0.8;
|
||||
Set_duty_ratio(&g_duty_ratio);
|
||||
|
|
|
@ -19,6 +19,10 @@
|
|||
//void rq_debug(const char *fmt, ...){};
|
||||
//#endif
|
||||
|
||||
#define RQ_OK 1
|
||||
#define RQ_ERROR 0
|
||||
#define RQ_OVERFLOW -2
|
||||
|
||||
//³õʼ»¯¶ÓÁÐ
|
||||
int InitRingQueue(RingQueue *q, RQ_ElementType *buff, int size)
|
||||
{
|
||||
|
|
|
@ -11,9 +11,6 @@
|
|||
|
||||
//#define RING_QUEUE_DEBUG //定义本宏会打印RingQueue的调试信息
|
||||
|
||||
#define RQ_OK 1
|
||||
#define RQ_ERROR 0
|
||||
#define RQ_OVERFLOW -2
|
||||
typedef unsigned char RQ_ElementType;//元素类型
|
||||
|
||||
typedef struct _ring_queue
|
||||
|
|
|
@ -0,0 +1,91 @@
|
|||
/*
|
||||
* ring_queue.c
|
||||
*
|
||||
* Created on: 2024年6月21日
|
||||
* Author: psx
|
||||
*/
|
||||
|
||||
|
||||
//循环队列
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include "ring_queue2.h"
|
||||
|
||||
|
||||
#define RQ_OK 1
|
||||
#define RQ_ERROR 0
|
||||
#define RQ_OVERFLOW -2
|
||||
//#define RING_QUEUE_DEBUG
|
||||
|
||||
//#ifdef RING_QUEUE_DEBUG
|
||||
//#define //rq_debug term_printf
|
||||
//#else
|
||||
//void rq_debug(const char *fmt, ...){};
|
||||
//#endif
|
||||
|
||||
//初始化队列
|
||||
int InitRingQueue2(RingQueue2 *q, RQ_ElementType2 *buff, int size)
|
||||
{
|
||||
q->elems = buff;
|
||||
q->size = size;
|
||||
q->front=q->rear=0;
|
||||
return RQ_OK;
|
||||
}
|
||||
|
||||
//遍历队列,
|
||||
//消费者使用,故对生产者可能修改的rear先读取缓存
|
||||
int ShowRingQueue2(RingQueue2 *q)
|
||||
{
|
||||
//int i;
|
||||
int rear = q->rear;
|
||||
|
||||
if(q->front == rear)
|
||||
{
|
||||
//rq_debug("队列为空\n");
|
||||
return RQ_ERROR;
|
||||
}
|
||||
//rq_debug("队列中的元素为:\n");
|
||||
//for(i=((q->front)%q->size); i != rear; i=((i+1)%q->size))
|
||||
//rq_debug(" %c\n",q->elems[i]);
|
||||
|
||||
//rq_debug("\n");
|
||||
//rq_debug("队首元素为%c\n",q->elems[q->front]);
|
||||
//rq_debug("队尾元素为%c\n",q->elems[rear - 1]);
|
||||
return RQ_OK;
|
||||
}
|
||||
|
||||
//向队尾插入元素e
|
||||
int InRingQueue2(RingQueue2 *q,RQ_ElementType2 e)
|
||||
{
|
||||
if(RingQueueFull2(q))
|
||||
{
|
||||
//rq_debug("空间不足\n");
|
||||
return(RQ_OVERFLOW);
|
||||
}
|
||||
q->elems[q->rear] = e;
|
||||
q->rear = (q->rear+1) % q->size;
|
||||
//rq_debug("rear = %d\n",q->rear);
|
||||
return RQ_OK;
|
||||
}
|
||||
|
||||
//从队首取回并删除元素
|
||||
int OutRingQueue2(RingQueue2 *q, RQ_ElementType2 *e)
|
||||
{
|
||||
if(RingQueueEmpty2(q))
|
||||
{
|
||||
//rq_debug("队列为空\n");
|
||||
return RQ_ERROR;
|
||||
}
|
||||
*e = q->elems[q->front];
|
||||
//rq_debug("被删除的队首元素为%c\n",q->elems[q->front]);
|
||||
q->front = (q->front+1) % q->size;
|
||||
return RQ_OK;
|
||||
}
|
||||
|
||||
//队列中的元素个数
|
||||
int RingQueueLength2(RingQueue2 *q)
|
||||
{
|
||||
return ((q->rear - q->front) + q->size) % q->size;
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,43 @@
|
|||
/*
|
||||
* ring_queue.h
|
||||
*
|
||||
* Created on: 2024年6月21日
|
||||
* Author: psx
|
||||
*/
|
||||
|
||||
#ifndef DRIVERS_RINGQUEUE_RING_QUEUE2_H_
|
||||
#define DRIVERS_RINGQUEUE_RING_QUEUE2_H_
|
||||
|
||||
|
||||
//#define RING_QUEUE_DEBUG //定义本宏会打印RingQueue的调试信息
|
||||
|
||||
typedef uint16_t RQ_ElementType2;//元素类型
|
||||
|
||||
typedef struct _ring_queue2
|
||||
{
|
||||
RQ_ElementType2 *elems;
|
||||
int size;
|
||||
volatile int front, rear;
|
||||
}RingQueue2;
|
||||
|
||||
//初始化队列,需传入保存队列状态的结构q,队列使用的buffer和buffer大小
|
||||
int InitRingQueue2(RingQueue2 *q, RQ_ElementType2 *buff, int size);
|
||||
|
||||
#define RingQueueFull2(q) (((q)->rear+1) % (q)->size == (q)->front)
|
||||
#define RingQueueEmpty2(q) ((q)->front == (q)->rear)
|
||||
|
||||
//遍历队列,
|
||||
//消费者使用,故对生产者可能修改的rear先读取缓存
|
||||
int ShowRingQueue2(RingQueue2 *q);
|
||||
|
||||
//向队尾插入元素e
|
||||
int InRingQueue2(RingQueue2 *q,RQ_ElementType2 e);
|
||||
|
||||
//从队首删除元素
|
||||
int OutRingQueue2(RingQueue2 *q, RQ_ElementType2 *e);
|
||||
|
||||
//队列中的元素个数
|
||||
int RingQueueLength2(RingQueue2 *q);
|
||||
|
||||
|
||||
#endif /* DRIVERS_RINGQUEUE_RING_QUEUE_H_ */
|
|
@ -2,6 +2,7 @@
|
|||
#define __ADC_H
|
||||
|
||||
#include "ch32l103.h"
|
||||
#include "ring_queue2.h"
|
||||
|
||||
//typedef struct _ADC_DATA {
|
||||
// uint16_t total_CHG_CURR; /* 一个控制周期中,adc采集的值之和 充电电流 */
|
||||
|
@ -18,23 +19,26 @@
|
|||
// uint16_t num_MOSFET_Temper;
|
||||
//}ADC_DATA;
|
||||
|
||||
#define data_len 50
|
||||
|
||||
typedef struct _ADC_DATA {
|
||||
uint16_t num; /* 一个控制周期中,adc采集次数 */
|
||||
uint16_t CHG_CURR_array[data_len]; /* 充电电流 */
|
||||
uint16_t PV_VOLT_OUT_array[data_len]; /* 输出电压 */
|
||||
uint16_t DSG_CURR_array[data_len]; /* 放电电流 */
|
||||
uint16_t PV_VOLT_IN_array[data_len]; /* 太阳能板输出电压 */
|
||||
uint16_t SYS_VOLT_IN_array[data_len]; /* 系统输入电压 */
|
||||
uint16_t MOSFET_Temper_array[data_len]; /* mos管温度 */
|
||||
}ADC_DATA;
|
||||
//#define data_len 50
|
||||
//typedef struct _ADC_DATA {
|
||||
// uint16_t num; /* 一个控制周期中,adc采集次数 */
|
||||
// uint16_t CHG_CURR_array[data_len]; /* 充电电流 */
|
||||
// uint16_t PV_VOLT_OUT_array[data_len]; /* 输出电压 */
|
||||
// uint16_t DSG_CURR_array[data_len]; /* 放电电流 */
|
||||
// uint16_t PV_VOLT_IN_array[data_len]; /* 太阳能板输出电压 */
|
||||
// uint16_t SYS_VOLT_IN_array[data_len]; /* 系统输入电压 */
|
||||
// uint16_t MOSFET_Temper_array[data_len]; /* mos管温度 */
|
||||
//}ADC_DATA;
|
||||
|
||||
#define adcBuffSize 100
|
||||
|
||||
typedef struct _ADC_DATA {
|
||||
RingQueue2 RQCHG_CURR;
|
||||
uint32_t total_CHG_CURR; /* 充电电流一段时间中adc值的和 */
|
||||
RingQueue2 RQDSG_CURR;
|
||||
uint32_t total_DSG_CURR; /* 放电电流一段时间中adc值的和 */
|
||||
}ADC_DATA;
|
||||
|
||||
extern ADC_DATA g_adcData;
|
||||
extern int16_t Calibrattion_Val;
|
||||
|
||||
|
|
|
@ -136,15 +136,35 @@ void TIM1_Init1(u16 arr,u16 psc)
|
|||
#define MOSFET_Temper ADC_Channel_6
|
||||
#define PV2_VOLT_IN ADC_Channel_7
|
||||
|
||||
static uint16_t CHG_CURR_buff[adcBuffSize];
|
||||
static uint16_t DSG_CURR_buff[adcBuffSize];
|
||||
|
||||
/*
|
||||
* 通过定时器和DMA完成adc的采集
|
||||
* 定时器采用定时器1的cc1完成ADC的外部触发 PA8 --> TIM1_CH1
|
||||
* ADC通过DMA的通道1完成数据的传输
|
||||
*
|
||||
* */
|
||||
volatile uint16_t ADC_ConvertedValue[3]; //ADC²ÉÑùµÄÊý¾Ý
|
||||
volatile uint16_t ADC_ConvertedValue[2]; //ADC²ÉÑùµÄÊý¾Ý
|
||||
void ADC_TIM_DMA_Init(void)
|
||||
{
|
||||
InitRingQueue2(&g_adcData.RQCHG_CURR, CHG_CURR_buff, adcBuffSize);
|
||||
InitRingQueue2(&g_adcData.RQDSG_CURR, DSG_CURR_buff, adcBuffSize);
|
||||
for (int var = 0; var < adcBuffSize; ++var) {
|
||||
InRingQueue2(&g_adcData.RQCHG_CURR, 0);
|
||||
InRingQueue2(&g_adcData.RQDSG_CURR, 0);
|
||||
}
|
||||
// while (RingQueueLength2(&g_adcData.RQCHG_CURR) != adcBuffSize) {
|
||||
// InRingQueue2(&g_adcData.RQCHG_CURR, 0);
|
||||
// };
|
||||
g_adcData.total_CHG_CURR = 0;
|
||||
|
||||
// while (RingQueueLength2(&g_adcData.RQDSG_CURR) != adcBuffSize) {
|
||||
// InRingQueue2(&g_adcData.RQDSG_CURR, 0);
|
||||
// };
|
||||
g_adcData.total_DSG_CURR = 0;
|
||||
|
||||
|
||||
ADC_InitTypeDef ADC_InitStructure = {0};
|
||||
GPIO_InitTypeDef GPIO_InitStructure = {0};
|
||||
|
||||
|
@ -155,7 +175,7 @@ void ADC_TIM_DMA_Init(void)
|
|||
// GPIO_InitStructure.GPIO_Pin = GPIO_Pin_1|GPIO_Pin_2|GPIO_Pin_3|GPIO_Pin_4|GPIO_Pin_5|GPIO_Pin_6; //PA1~7对应ADC通道1~7
|
||||
// GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AIN;
|
||||
// GPIO_Init(GPIOA, &GPIO_InitStructure);
|
||||
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_1|GPIO_Pin_2|GPIO_Pin_3; //PA1~7¶ÔÓ¦ADCͨµÀ1~7
|
||||
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_1 | GPIO_Pin_3; //PA1~7¶ÔÓ¦ADCͨµÀ1~7
|
||||
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AIN;
|
||||
GPIO_Init(GPIOA, &GPIO_InitStructure);
|
||||
|
||||
|
@ -168,7 +188,7 @@ void ADC_TIM_DMA_Init(void)
|
|||
ADC_InitStructure.ADC_ExternalTrigConv = ADC_ExternalTrigConv_T1_CC1;
|
||||
ADC_InitStructure.ADC_DataAlign = ADC_DataAlign_Right;
|
||||
// ADC_InitStructure.ADC_NbrOfChannel = 1;
|
||||
ADC_InitStructure.ADC_NbrOfChannel = 3;
|
||||
ADC_InitStructure.ADC_NbrOfChannel = 2;
|
||||
ADC_Init(ADC1, &ADC_InitStructure);
|
||||
|
||||
//使能ADC、DMA
|
||||
|
@ -193,17 +213,16 @@ void ADC_TIM_DMA_Init(void)
|
|||
// ADC_RegularChannelConfig(ADC1, SYS_VOLT_IN, 5, ADC_SampleTime_CyclesMode5);
|
||||
// ADC_RegularChannelConfig(ADC1, MOSFET_Temper, 6, ADC_SampleTime_CyclesMode5);
|
||||
|
||||
ADC_RegularChannelConfig(ADC1, CHG_CURR, 1, ADC_SampleTime_CyclesMode5);
|
||||
ADC_RegularChannelConfig(ADC1, PV_VOLT_OUT, 2, ADC_SampleTime_CyclesMode5);
|
||||
ADC_RegularChannelConfig(ADC1, DSG_CURR, 3, ADC_SampleTime_CyclesMode5);
|
||||
ADC_RegularChannelConfig(ADC1, CHG_CURR, 1, ADC_SampleTime_CyclesMode5);
|
||||
ADC_RegularChannelConfig(ADC1, DSG_CURR, 2, ADC_SampleTime_CyclesMode5);
|
||||
|
||||
// /* 设置定时器输出的周期为1S */
|
||||
// TIM1_Init1(1000, 48000);
|
||||
/* 设置定时器输出的周期为30mS */
|
||||
TIM1_Init1(30, 48000);
|
||||
// TIM1_Init1(30, 48000);
|
||||
/* 设置定时器输出的周期为100uS */
|
||||
// TIM1_Init1(300, 48);
|
||||
DMA_Tx_Init((u32)&ADC_ConvertedValue, 3);
|
||||
TIM1_Init1(10, 48000);
|
||||
DMA_Tx_Init((u32)&ADC_ConvertedValue, 2);
|
||||
|
||||
|
||||
|
||||
|
@ -253,8 +272,20 @@ void DMA1_Channel1_IRQHandler(void)
|
|||
// printf("\r\nEnter DMA interrupt\r\n");
|
||||
if(DMA_GetITStatus(DMA1_IT_TC1)!=RESET)
|
||||
{
|
||||
DMA_ClearITPendingBit(DMA1_IT_TC1);
|
||||
//中断处理代码
|
||||
static uint16_t temp;
|
||||
|
||||
OutRingQueue2(&g_adcData.RQCHG_CURR, &temp);
|
||||
g_adcData.total_CHG_CURR -= temp;
|
||||
OutRingQueue2(&g_adcData.RQDSG_CURR, &temp);
|
||||
g_adcData.total_DSG_CURR -= temp;
|
||||
|
||||
g_adcData.total_CHG_CURR += ADC_ConvertedValue[0];
|
||||
g_adcData.total_DSG_CURR += ADC_ConvertedValue[1];
|
||||
InRingQueue2(&g_adcData.RQCHG_CURR, ADC_ConvertedValue[0]);
|
||||
InRingQueue2(&g_adcData.RQDSG_CURR, ADC_ConvertedValue[1]);
|
||||
|
||||
DMA_ClearITPendingBit(DMA1_IT_TC1);
|
||||
// g_adcData.CHG_CURR_array[g_adcData.num] = Get_ConversionVal1(ADC_ConvertedValue[0]);
|
||||
// g_adcData.PV_VOLT_OUT_array[g_adcData.num] = Get_ConversionVal1(ADC_ConvertedValue[1]);
|
||||
// g_adcData.DSG_CURR_array[g_adcData.num] = Get_ConversionVal1(ADC_ConvertedValue[2]);
|
||||
|
@ -273,9 +304,9 @@ void DMA1_Channel1_IRQHandler(void)
|
|||
|
||||
// g_adcData.total_CHG_CURR += Get_ConversionVal1(ADC_ConvertedValue[0]);
|
||||
|
||||
printf("%d\n", ADC_ConvertedValue[0]);
|
||||
printf("%d\n", ADC_ConvertedValue[1]);
|
||||
printf("%d\r\n", ADC_ConvertedValue[2]);
|
||||
// printf("%d\n", ADC_ConvertedValue[0]);
|
||||
// printf("%d\n", ADC_ConvertedValue[1]);
|
||||
|
||||
// printf("%d\n", ADC_ConvertedValue[3]);
|
||||
// printf("%d\n", ADC_ConvertedValue[4]);
|
||||
// printf("%d\r\n", ADC_ConvertedValue[5]);
|
||||
|
|
|
@ -26,8 +26,9 @@ App/src/collect_Conversion.o: ../App/src/collect_Conversion.c \
|
|||
D:\psx\MPPT\git\Peripheral\inc/ch32l103_misc.h \
|
||||
D:\psx\MPPT\git\Peripheral\inc/ch32l103_lptim.h \
|
||||
D:\psx\MPPT\git\Peripheral\inc/ch32l103_opa.h \
|
||||
D:\psx\MPPT\git\Hardware\inc/adc.h D:\psx\MPPT\git\Hardware\inc/gpio.h \
|
||||
D:\psx\MPPT\git\App\inc/uart_dev.h \
|
||||
D:\psx\MPPT\git\Hardware\inc/adc.h \
|
||||
D:\psx\MPPT\git\Drivers\RingQueue2/ring_queue2.h \
|
||||
D:\psx\MPPT\git\Hardware\inc/gpio.h D:\psx\MPPT\git\App\inc/uart_dev.h \
|
||||
D:\psx\MPPT\git\Drivers\RingQueue/ring_queue.h \
|
||||
D:\psx\MPPT\git\Hardware\inc/rs485.h
|
||||
|
||||
|
@ -91,6 +92,8 @@ D:\psx\MPPT\git\Peripheral\inc/ch32l103_opa.h:
|
|||
|
||||
D:\psx\MPPT\git\Hardware\inc/adc.h:
|
||||
|
||||
D:\psx\MPPT\git\Drivers\RingQueue2/ring_queue2.h:
|
||||
|
||||
D:\psx\MPPT\git\Hardware\inc/gpio.h:
|
||||
|
||||
D:\psx\MPPT\git\App\inc/uart_dev.h:
|
||||
|
|
Binary file not shown.
|
@ -27,8 +27,10 @@ App/src/mppt_control.o: ../App/src/mppt_control.c \
|
|||
D:\psx\MPPT\git\Peripheral\inc/ch32l103_lptim.h \
|
||||
D:\psx\MPPT\git\Peripheral\inc/ch32l103_opa.h \
|
||||
D:\psx\MPPT\git\App\inc/collect_Conversion.h \
|
||||
D:\psx\MPPT\git\Hardware\inc/adc.h D:\psx\MPPT\git\Hardware\inc/pwm.h \
|
||||
D:\psx\MPPT\git\App\inc/inflash.h D:\psx\MPPT\git\Hardware\inc/gpio.h \
|
||||
D:\psx\MPPT\git\Hardware\inc/adc.h \
|
||||
D:\psx\MPPT\git\Drivers\RingQueue2/ring_queue2.h \
|
||||
D:\psx\MPPT\git\Hardware\inc/pwm.h D:\psx\MPPT\git\App\inc/inflash.h \
|
||||
D:\psx\MPPT\git\Hardware\inc/gpio.h \
|
||||
D:\psx\MPPT\git\App\inc/sl_protocol.h D:\psx\MPPT\git\App\inc/uart_dev.h \
|
||||
D:\psx\MPPT\git\Drivers\RingQueue/ring_queue.h \
|
||||
D:\psx\MPPT\git\Hardware\inc/rs485.h D:\psx\MPPT\git\App\inc/task.h \
|
||||
|
@ -97,6 +99,8 @@ D:\psx\MPPT\git\App\inc/collect_Conversion.h:
|
|||
|
||||
D:\psx\MPPT\git\Hardware\inc/adc.h:
|
||||
|
||||
D:\psx\MPPT\git\Drivers\RingQueue2/ring_queue2.h:
|
||||
|
||||
D:\psx\MPPT\git\Hardware\inc/pwm.h:
|
||||
|
||||
D:\psx\MPPT\git\App\inc/inflash.h:
|
||||
|
|
Binary file not shown.
|
@ -31,6 +31,6 @@ C_DEPS += \
|
|||
|
||||
# Each subdirectory must supply rules for building sources it contributes
|
||||
App/src/%.o: ../App/src/%.c
|
||||
@ @ riscv-none-embed-gcc -march=rv32imacxw -mabi=ilp32 -msmall-data-limit=8 -msave-restore -Os -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -fno-common -Wunused -Wuninitialized -g -I"D:\psx\MPPT\git\Debug" -I"D:\psx\MPPT\git\Core" -I"D:\psx\MPPT\git\User" -I"D:\psx\MPPT\git\Peripheral\inc" -I"D:\psx\MPPT\git\App\inc" -I"D:\psx\MPPT\git\Hardware\inc" -I"D:\psx\MPPT\git\Drivers\RingQueue" -I"D:\psx\MPPT\git\Drivers\TimeSliceOffset" -std=gnu99 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -c -o "$@" "$<"
|
||||
@ @ riscv-none-embed-gcc -march=rv32imacxw -mabi=ilp32 -msmall-data-limit=8 -msave-restore -Os -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -fno-common -Wunused -Wuninitialized -g -I"D:\psx\MPPT\git\Debug" -I"D:\psx\MPPT\git\Core" -I"D:\psx\MPPT\git\User" -I"D:\psx\MPPT\git\Peripheral\inc" -I"D:\psx\MPPT\git\App\inc" -I"D:\psx\MPPT\git\Hardware\inc" -I"D:\psx\MPPT\git\Drivers\TimeSliceOffset" -I"D:\psx\MPPT\git\Drivers\RingQueue" -I"D:\psx\MPPT\git\Drivers\RingQueue2" -std=gnu99 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -c -o "$@" "$<"
|
||||
@ @
|
||||
|
||||
|
|
|
@ -30,8 +30,9 @@ App/src/task.o: ../App/src/task.c D:\psx\MPPT\git\App\inc/task.h \
|
|||
D:\psx\MPPT\git\Drivers\RingQueue/ring_queue.h \
|
||||
D:\psx\MPPT\git\Hardware\inc/rs485.h D:\psx\MPPT\git\App\inc/uart_dev.h \
|
||||
D:\psx\MPPT\git\Hardware\inc/tim.h D:\psx\MPPT\git\Hardware\inc/pwm.h \
|
||||
D:\psx\MPPT\git\Hardware\inc/adc.h D:\psx\MPPT\git\Hardware\inc/gpio.h \
|
||||
D:\psx\MPPT\git\Hardware\inc/flash.h \
|
||||
D:\psx\MPPT\git\Hardware\inc/adc.h \
|
||||
D:\psx\MPPT\git\Drivers\RingQueue2/ring_queue2.h \
|
||||
D:\psx\MPPT\git\Hardware\inc/gpio.h D:\psx\MPPT\git\Hardware\inc/flash.h \
|
||||
D:\psx\MPPT\git\App\inc/sl_protocol.h \
|
||||
D:\psx\MPPT\git\App\inc/mppt_control.h D:\psx\MPPT\git\App\inc/inflash.h \
|
||||
D:\psx\MPPT\git\App\inc/collect_Conversion.h
|
||||
|
@ -110,6 +111,8 @@ D:\psx\MPPT\git\Hardware\inc/pwm.h:
|
|||
|
||||
D:\psx\MPPT\git\Hardware\inc/adc.h:
|
||||
|
||||
D:\psx\MPPT\git\Drivers\RingQueue2/ring_queue2.h:
|
||||
|
||||
D:\psx\MPPT\git\Hardware\inc/gpio.h:
|
||||
|
||||
D:\psx\MPPT\git\Hardware\inc/flash.h:
|
||||
|
|
Binary file not shown.
Binary file not shown.
|
@ -16,6 +16,6 @@ C_DEPS += \
|
|||
|
||||
# Each subdirectory must supply rules for building sources it contributes
|
||||
Core/%.o: ../Core/%.c
|
||||
@ @ riscv-none-embed-gcc -march=rv32imacxw -mabi=ilp32 -msmall-data-limit=8 -msave-restore -Os -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -fno-common -Wunused -Wuninitialized -g -I"D:\psx\MPPT\git\Debug" -I"D:\psx\MPPT\git\Core" -I"D:\psx\MPPT\git\User" -I"D:\psx\MPPT\git\Peripheral\inc" -I"D:\psx\MPPT\git\App\inc" -I"D:\psx\MPPT\git\Hardware\inc" -I"D:\psx\MPPT\git\Drivers\RingQueue" -I"D:\psx\MPPT\git\Drivers\TimeSliceOffset" -std=gnu99 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -c -o "$@" "$<"
|
||||
@ @ riscv-none-embed-gcc -march=rv32imacxw -mabi=ilp32 -msmall-data-limit=8 -msave-restore -Os -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -fno-common -Wunused -Wuninitialized -g -I"D:\psx\MPPT\git\Debug" -I"D:\psx\MPPT\git\Core" -I"D:\psx\MPPT\git\User" -I"D:\psx\MPPT\git\Peripheral\inc" -I"D:\psx\MPPT\git\App\inc" -I"D:\psx\MPPT\git\Hardware\inc" -I"D:\psx\MPPT\git\Drivers\TimeSliceOffset" -I"D:\psx\MPPT\git\Drivers\RingQueue" -I"D:\psx\MPPT\git\Drivers\RingQueue2" -std=gnu99 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -c -o "$@" "$<"
|
||||
@ @
|
||||
|
||||
|
|
|
@ -16,6 +16,6 @@ C_DEPS += \
|
|||
|
||||
# Each subdirectory must supply rules for building sources it contributes
|
||||
Debug/%.o: ../Debug/%.c
|
||||
@ @ riscv-none-embed-gcc -march=rv32imacxw -mabi=ilp32 -msmall-data-limit=8 -msave-restore -Os -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -fno-common -Wunused -Wuninitialized -g -I"D:\psx\MPPT\git\Debug" -I"D:\psx\MPPT\git\Core" -I"D:\psx\MPPT\git\User" -I"D:\psx\MPPT\git\Peripheral\inc" -I"D:\psx\MPPT\git\App\inc" -I"D:\psx\MPPT\git\Hardware\inc" -I"D:\psx\MPPT\git\Drivers\RingQueue" -I"D:\psx\MPPT\git\Drivers\TimeSliceOffset" -std=gnu99 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -c -o "$@" "$<"
|
||||
@ @ riscv-none-embed-gcc -march=rv32imacxw -mabi=ilp32 -msmall-data-limit=8 -msave-restore -Os -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -fno-common -Wunused -Wuninitialized -g -I"D:\psx\MPPT\git\Debug" -I"D:\psx\MPPT\git\Core" -I"D:\psx\MPPT\git\User" -I"D:\psx\MPPT\git\Peripheral\inc" -I"D:\psx\MPPT\git\App\inc" -I"D:\psx\MPPT\git\Hardware\inc" -I"D:\psx\MPPT\git\Drivers\TimeSliceOffset" -I"D:\psx\MPPT\git\Drivers\RingQueue" -I"D:\psx\MPPT\git\Drivers\RingQueue2" -std=gnu99 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -c -o "$@" "$<"
|
||||
@ @
|
||||
|
||||
|
|
Binary file not shown.
|
@ -16,6 +16,6 @@ C_DEPS += \
|
|||
|
||||
# Each subdirectory must supply rules for building sources it contributes
|
||||
Drivers/RingQueue/%.o: ../Drivers/RingQueue/%.c
|
||||
@ @ riscv-none-embed-gcc -march=rv32imacxw -mabi=ilp32 -msmall-data-limit=8 -msave-restore -Os -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -fno-common -Wunused -Wuninitialized -g -I"D:\psx\MPPT\git\Debug" -I"D:\psx\MPPT\git\Core" -I"D:\psx\MPPT\git\User" -I"D:\psx\MPPT\git\Peripheral\inc" -I"D:\psx\MPPT\git\App\inc" -I"D:\psx\MPPT\git\Hardware\inc" -I"D:\psx\MPPT\git\Drivers\RingQueue" -I"D:\psx\MPPT\git\Drivers\TimeSliceOffset" -std=gnu99 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -c -o "$@" "$<"
|
||||
@ @ riscv-none-embed-gcc -march=rv32imacxw -mabi=ilp32 -msmall-data-limit=8 -msave-restore -Os -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -fno-common -Wunused -Wuninitialized -g -I"D:\psx\MPPT\git\Debug" -I"D:\psx\MPPT\git\Core" -I"D:\psx\MPPT\git\User" -I"D:\psx\MPPT\git\Peripheral\inc" -I"D:\psx\MPPT\git\App\inc" -I"D:\psx\MPPT\git\Hardware\inc" -I"D:\psx\MPPT\git\Drivers\TimeSliceOffset" -I"D:\psx\MPPT\git\Drivers\RingQueue" -I"D:\psx\MPPT\git\Drivers\RingQueue2" -std=gnu99 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -c -o "$@" "$<"
|
||||
@ @
|
||||
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
Drivers/RingQueue2/ring_queue2.o: ../Drivers/RingQueue2/ring_queue2.c \
|
||||
../Drivers/RingQueue2/ring_queue2.h
|
||||
|
||||
../Drivers/RingQueue2/ring_queue2.h:
|
Binary file not shown.
|
@ -0,0 +1,21 @@
|
|||
################################################################################
|
||||
# MRS Version: 1.9.0
|
||||
# 自动生成的文件。不要编辑!
|
||||
################################################################################
|
||||
|
||||
# Add inputs and outputs from these tool invocations to the build variables
|
||||
C_SRCS += \
|
||||
../Drivers/RingQueue2/ring_queue2.c
|
||||
|
||||
OBJS += \
|
||||
./Drivers/RingQueue2/ring_queue2.o
|
||||
|
||||
C_DEPS += \
|
||||
./Drivers/RingQueue2/ring_queue2.d
|
||||
|
||||
|
||||
# Each subdirectory must supply rules for building sources it contributes
|
||||
Drivers/RingQueue2/%.o: ../Drivers/RingQueue2/%.c
|
||||
@ @ riscv-none-embed-gcc -march=rv32imacxw -mabi=ilp32 -msmall-data-limit=8 -msave-restore -Os -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -fno-common -Wunused -Wuninitialized -g -I"D:\psx\MPPT\git\Debug" -I"D:\psx\MPPT\git\Core" -I"D:\psx\MPPT\git\User" -I"D:\psx\MPPT\git\Peripheral\inc" -I"D:\psx\MPPT\git\App\inc" -I"D:\psx\MPPT\git\Hardware\inc" -I"D:\psx\MPPT\git\Drivers\TimeSliceOffset" -I"D:\psx\MPPT\git\Drivers\RingQueue" -I"D:\psx\MPPT\git\Drivers\RingQueue2" -std=gnu99 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -c -o "$@" "$<"
|
||||
@ @
|
||||
|
|
@ -16,6 +16,6 @@ C_DEPS += \
|
|||
|
||||
# Each subdirectory must supply rules for building sources it contributes
|
||||
Drivers/TimeSliceOffset/%.o: ../Drivers/TimeSliceOffset/%.c
|
||||
@ @ riscv-none-embed-gcc -march=rv32imacxw -mabi=ilp32 -msmall-data-limit=8 -msave-restore -Os -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -fno-common -Wunused -Wuninitialized -g -I"D:\psx\MPPT\git\Debug" -I"D:\psx\MPPT\git\Core" -I"D:\psx\MPPT\git\User" -I"D:\psx\MPPT\git\Peripheral\inc" -I"D:\psx\MPPT\git\App\inc" -I"D:\psx\MPPT\git\Hardware\inc" -I"D:\psx\MPPT\git\Drivers\RingQueue" -I"D:\psx\MPPT\git\Drivers\TimeSliceOffset" -std=gnu99 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -c -o "$@" "$<"
|
||||
@ @ riscv-none-embed-gcc -march=rv32imacxw -mabi=ilp32 -msmall-data-limit=8 -msave-restore -Os -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -fno-common -Wunused -Wuninitialized -g -I"D:\psx\MPPT\git\Debug" -I"D:\psx\MPPT\git\Core" -I"D:\psx\MPPT\git\User" -I"D:\psx\MPPT\git\Peripheral\inc" -I"D:\psx\MPPT\git\App\inc" -I"D:\psx\MPPT\git\Hardware\inc" -I"D:\psx\MPPT\git\Drivers\TimeSliceOffset" -I"D:\psx\MPPT\git\Drivers\RingQueue" -I"D:\psx\MPPT\git\Drivers\RingQueue2" -std=gnu99 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -c -o "$@" "$<"
|
||||
@ @
|
||||
|
||||
|
|
|
@ -25,7 +25,8 @@ Hardware/src/adc.o: ../Hardware/src/adc.c \
|
|||
D:\psx\MPPT\git\User/ch32l103_it.h D:\psx\MPPT\git\Debug/debug.h \
|
||||
D:\psx\MPPT\git\Peripheral\inc/ch32l103_misc.h \
|
||||
D:\psx\MPPT\git\Peripheral\inc/ch32l103_lptim.h \
|
||||
D:\psx\MPPT\git\Peripheral\inc/ch32l103_opa.h
|
||||
D:\psx\MPPT\git\Peripheral\inc/ch32l103_opa.h \
|
||||
D:\psx\MPPT\git\Drivers\RingQueue2/ring_queue2.h
|
||||
|
||||
D:\psx\MPPT\git\Hardware\inc/adc.h:
|
||||
|
||||
|
@ -84,3 +85,5 @@ D:\psx\MPPT\git\Peripheral\inc/ch32l103_misc.h:
|
|||
D:\psx\MPPT\git\Peripheral\inc/ch32l103_lptim.h:
|
||||
|
||||
D:\psx\MPPT\git\Peripheral\inc/ch32l103_opa.h:
|
||||
|
||||
D:\psx\MPPT\git\Drivers\RingQueue2/ring_queue2.h:
|
||||
|
|
Binary file not shown.
Binary file not shown.
|
@ -31,6 +31,6 @@ C_DEPS += \
|
|||
|
||||
# Each subdirectory must supply rules for building sources it contributes
|
||||
Hardware/src/%.o: ../Hardware/src/%.c
|
||||
@ @ riscv-none-embed-gcc -march=rv32imacxw -mabi=ilp32 -msmall-data-limit=8 -msave-restore -Os -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -fno-common -Wunused -Wuninitialized -g -I"D:\psx\MPPT\git\Debug" -I"D:\psx\MPPT\git\Core" -I"D:\psx\MPPT\git\User" -I"D:\psx\MPPT\git\Peripheral\inc" -I"D:\psx\MPPT\git\App\inc" -I"D:\psx\MPPT\git\Hardware\inc" -I"D:\psx\MPPT\git\Drivers\RingQueue" -I"D:\psx\MPPT\git\Drivers\TimeSliceOffset" -std=gnu99 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -c -o "$@" "$<"
|
||||
@ @ riscv-none-embed-gcc -march=rv32imacxw -mabi=ilp32 -msmall-data-limit=8 -msave-restore -Os -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -fno-common -Wunused -Wuninitialized -g -I"D:\psx\MPPT\git\Debug" -I"D:\psx\MPPT\git\Core" -I"D:\psx\MPPT\git\User" -I"D:\psx\MPPT\git\Peripheral\inc" -I"D:\psx\MPPT\git\App\inc" -I"D:\psx\MPPT\git\Hardware\inc" -I"D:\psx\MPPT\git\Drivers\TimeSliceOffset" -I"D:\psx\MPPT\git\Drivers\RingQueue" -I"D:\psx\MPPT\git\Drivers\RingQueue2" -std=gnu99 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -c -o "$@" "$<"
|
||||
@ @
|
||||
|
||||
|
|
|
@ -76,6 +76,6 @@ C_DEPS += \
|
|||
|
||||
# Each subdirectory must supply rules for building sources it contributes
|
||||
Peripheral/src/%.o: ../Peripheral/src/%.c
|
||||
@ @ riscv-none-embed-gcc -march=rv32imacxw -mabi=ilp32 -msmall-data-limit=8 -msave-restore -Os -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -fno-common -Wunused -Wuninitialized -g -I"D:\psx\MPPT\git\Debug" -I"D:\psx\MPPT\git\Core" -I"D:\psx\MPPT\git\User" -I"D:\psx\MPPT\git\Peripheral\inc" -I"D:\psx\MPPT\git\App\inc" -I"D:\psx\MPPT\git\Hardware\inc" -I"D:\psx\MPPT\git\Drivers\RingQueue" -I"D:\psx\MPPT\git\Drivers\TimeSliceOffset" -std=gnu99 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -c -o "$@" "$<"
|
||||
@ @ riscv-none-embed-gcc -march=rv32imacxw -mabi=ilp32 -msmall-data-limit=8 -msave-restore -Os -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -fno-common -Wunused -Wuninitialized -g -I"D:\psx\MPPT\git\Debug" -I"D:\psx\MPPT\git\Core" -I"D:\psx\MPPT\git\User" -I"D:\psx\MPPT\git\Peripheral\inc" -I"D:\psx\MPPT\git\App\inc" -I"D:\psx\MPPT\git\Hardware\inc" -I"D:\psx\MPPT\git\Drivers\TimeSliceOffset" -I"D:\psx\MPPT\git\Drivers\RingQueue" -I"D:\psx\MPPT\git\Drivers\RingQueue2" -std=gnu99 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -c -o "$@" "$<"
|
||||
@ @
|
||||
|
||||
|
|
|
@ -22,6 +22,6 @@ C_DEPS += \
|
|||
|
||||
# Each subdirectory must supply rules for building sources it contributes
|
||||
User/%.o: ../User/%.c
|
||||
@ @ riscv-none-embed-gcc -march=rv32imacxw -mabi=ilp32 -msmall-data-limit=8 -msave-restore -Os -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -fno-common -Wunused -Wuninitialized -g -I"D:\psx\MPPT\git\Debug" -I"D:\psx\MPPT\git\Core" -I"D:\psx\MPPT\git\User" -I"D:\psx\MPPT\git\Peripheral\inc" -I"D:\psx\MPPT\git\App\inc" -I"D:\psx\MPPT\git\Hardware\inc" -I"D:\psx\MPPT\git\Drivers\RingQueue" -I"D:\psx\MPPT\git\Drivers\TimeSliceOffset" -std=gnu99 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -c -o "$@" "$<"
|
||||
@ @ riscv-none-embed-gcc -march=rv32imacxw -mabi=ilp32 -msmall-data-limit=8 -msave-restore -Os -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -fno-common -Wunused -Wuninitialized -g -I"D:\psx\MPPT\git\Debug" -I"D:\psx\MPPT\git\Core" -I"D:\psx\MPPT\git\User" -I"D:\psx\MPPT\git\Peripheral\inc" -I"D:\psx\MPPT\git\App\inc" -I"D:\psx\MPPT\git\Hardware\inc" -I"D:\psx\MPPT\git\Drivers\TimeSliceOffset" -I"D:\psx\MPPT\git\Drivers\RingQueue" -I"D:\psx\MPPT\git\Drivers\RingQueue2" -std=gnu99 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -c -o "$@" "$<"
|
||||
@ @
|
||||
|
||||
|
|
|
@ -14,6 +14,7 @@ RM := rm -rf
|
|||
-include Peripheral/src/subdir.mk
|
||||
-include Hardware/src/subdir.mk
|
||||
-include Drivers/TimeSliceOffset/subdir.mk
|
||||
-include Drivers/RingQueue2/subdir.mk
|
||||
-include Drivers/RingQueue/subdir.mk
|
||||
-include Debug/subdir.mk
|
||||
-include Core/subdir.mk
|
||||
|
|
Binary file not shown.
Binary file not shown.
File diff suppressed because it is too large
Load Diff
12590
obj/mppt_Nos_V0.4.lst
12590
obj/mppt_Nos_V0.4.lst
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -27,6 +27,7 @@ App/src \
|
|||
Core \
|
||||
Debug \
|
||||
Drivers/RingQueue \
|
||||
Drivers/RingQueue2 \
|
||||
Drivers/TimeSliceOffset \
|
||||
Hardware/src \
|
||||
Peripheral/src \
|
||||
|
|
Loading…
Reference in New Issue