데이터 크기 설정하는 malloc함수인데요...
주리
2023.04.01
SramData = (SramDataType*)malloc(SRAM_DATA_NO*sizeof(SramDataType));
로 설정이 되어있습니다.
#define SRAM_DATA_NO 10000
되어있구요.
SramDataType는 구조체로
typedef struct {
Uint16 IsrTimer1Cnt32;
Int16 AdIn[SRAM_DATA_CH];
} SramDataType;
과 같이 되어있습니다.
#define SRAM_DATA_CH 8
로 되어있습니다.
그리고
GLOBAL Uint32 IsrTimer1Cnt32 INIT(0);
로 설정되어 잇습니다. 그러다면 SramData의 크기는 얼마일까요.. 계산이 힘드네요..
Uint16 은 unsigned int16입니다.
제가 알기론 SramData형으로 데이터를 잡는데 10000*( )이죠
이 ( )는 구조체의 크기로Uint16 IsrTimer1Cnt32;는 2byte인데.. 이 변수를 찾아가보면
GLOBAL Uint32 IsrTimer1Cnt32 INIT(0);걸로 다시 선언되어잇습니다.. 좀헷갈리네요.. 답변좀. ㅠㅠ
-
벛꽃
앗 어떻게 40000바이트가 나왔나요?? 계산하는거좀 알려주세요!! ㅠㅠ
-
나오
40000바이트아닐련지..