I am trying to find out what is wrong with my code. I have this code and everything is properly included, but the compiler said Symbol 'b_t' could not be resolved
:
#ifndef slow_CAL_H
#define slow_CAL_H
/* slow Struct data */
typedef struct slow_struct_tag {
const int16_T b_t[7];
} slow_struct_type;
extern const slow_struct_type slow_struct;
extern const slow_struct_type *slow_struct;
#endif
slow_private.h
#ifndef slow_private_h_
#define slow_private_h_
#include "slow_cal.h"
#endif
slow.c
#include "slow.h"
#include "slow_private.h"
int main() {
foo(&b_t[0]);
return 0;
}
void foo(int16_T *pY) {
*pY++;
}
This foo()
is not the real function, the real function is the following:
void INTERPOLATE_S16_S16_ZERO(int16_T *pY, int16_T yL, int16_T yR,
int16_T x, int16_T xL, int16_T xR)
{
int32_T bigProd;
int16_T yDiff;
int16_T xNum;
int16_T xDen;
*pY = yL;
/* If x is not strictly between xR and xL
* then an interpolation calculation is not necessary x == xL
* or not valid. The invalid situation is expected when the input
* is beyond the left or right end of the table. The design is
* that yL holds the correct value for *pY
* in invalid situations.
*/
if ((xR > xL) && (x > xL) ) {
xDen = xR;
xDen = (int16_T)(xDen - xL);
xNum = x;
xNum = (int16_T)(xNum - xL);
yDiff = yR;
yDiff = (int16_T)(yDiff - yL);
bigProd = yDiff * xNum;
yDiff = div_s16s32(bigProd, (int32_T)xDen);
*pY = (int16_T)(*pY + yDiff);
}
}
However, I don't want to post a chaotic code with five or six different files.