I tried to program this code on an STM8 Controller:
#include "Imagedata.h"
void main(void)
{
unsigned char *pArray;
pArray=IMAGE_DATA;
while(pArray<=(IMAGE_DATA+(sizeof(IMAGE_DATA)/sizeof(pArray))))
{
SPI_SendData(SPI1,*pArray++ );
}
}
Actually the array is much longer than this but it would take to much space here. The Array is defined in imagedata.c:
#include "imagedata.h"
const unsigned char IMAGE_DATA[]= { 0X00,0X01,0XC8,0X00,0XC8,0X00};
After compiling this code I get the error message: array size unknown. This refers to the line where I put sizeof(IMAGE_DATA). I don't quiet understand what the problem is. Can anyone help?