Gast
#5393816
Hallo ich will den Datentyp aus Header 1 ic_t in eine zweites Header 2
File includieren um Ihn in fan_t zu verwenden, dabei bekomme ich
folgenden Fehler:
.\SRC\Control\FAN_CONTROL\fan_control.h(31): error: #20: identifier
"ic_t" is undefined
Meine google suche hat leider zu keinem Erfolg geführt, hat mir
vielleicht jemand einen Tip wie es richtig geht?
//Header 1 -> input_capture.h
/* Define to prevent recursive inclusion
-------------------------------------*/
#ifndef __input_capture_H
#define __input_capture_H
#ifdef __cplusplus
extern "C" {
#endif
#include <stdint.h>
#include "stm32f4xx_hal.h"
typedef enum {
IC_STATE_NO_INIT = 0,
IC_STATE_OK,
IC_STATE_ERROR
} ic_status_t;
typedef struct {
ic_status_t status;
uint16_t rpm;
uint16_t timer;
TIM_HandleTypeDef hICtim;
TIM_HandleTypeDef *p_channel;
uint32_t icChannel;
uint16_t lastICVal;
uint16_t actualSteps;
uint16_t targetSteps;
uint16_t lastCntVal;
uint16_t cntSteps;
} ic_t;
/* declaration of function prototypes
-----------------------------------------*/
void ic_fan_start(ic_t* pThis);
uint16_t ic_get_fan_rpm (ic_t *pThis);
uint32_t ic_calc_prescaler(uint32_t freq);
void ic_fan_init(ic_t *pThis, uint32_t tim_cnt_mode);
void fan_input_capture_isr(ic_t * pThis);
#ifdef __cplusplus
}
#endif
#endif /* __input_capture_H */
//Header 2 -> -> fan_control.h
/* Define to prevent recursive inclusion
-------------------------------------*/
#ifndef __fan_control_H
#define __fan_control_H
#ifdef __cplusplus
extern "C" {
#endif
#include "stdint.h"
#include "input_capture.h"
#include "pwm.h"
typedef enum {
FAN_STATE_IDLE = 0,
FAN_STATE_ON,
FAN_STATE_ERROR,
} fan_state_t;
typedef struct {
fan_state_t state;
ic_t tacho;
pwm_t pwm;
uint16_t timer;
float esum;
} fan_t;
/* Private typedef
-----------------------------------------------------------*/
void set_ic_fan1(fan_t* pThis);
fan_state_t fan_run (fan_t *pThis);
uint16_t fan_getActualRPM (fan_t *pThis);
void fan_pi_controller (fan_t *pThis);
fan_state_t fan_run (fan_t * pThis);
#ifdef __cplusplus
}
#endif
#endif /* __fan_control_H */
