I am trying to store data in the PROGMEM and retrieve it later. Then send them through USB serial comms to screen.
int8_t serial_comm_write(const uint8_t *buffer, uint16_t size){
//Here contains the code from the lib which I don't understand.
//Basically, it's sending data (char *data) thru to screen.
}
//This char *data could simply be:
// char *line = "This is stored in RAM"
//usb_send_info(line); would send the "line" to the screen.
void usb_send_info(char *data){
serial_comm_write((uint8_t *)data, strlen(data));
}
//This doesn't work. I got a squiggly line saying "unknown register name
//'r0'
//have no idea what it means.
void usb_send_info_P(const char *data){
while(pgm_read_byte(data) != 0x00){
usb_send_info((pgm_read_byte(data++)));
}
}
const static char line1[] PROGMEM = "This is stored in flash mem";
usb_send_info_P(line1);
It just doesn't work. Any tips or alternatives? Cheers.