Hi Guys,
I have the following question regarding function running in using the __attribute__((ramfunc)).
What happens to function calls that are made within the function running in RAM?
Is it necessary to place them in RAM too in order to get the optmisation?
The function in the example below is placed in RAM but uart_write(), uart_read(timeout) and check_resp(command_id) don't have the __attribute__((ramfunc))
__attribute__((ramfunc))
static void query(Cmd_Id_e command_id,uint16_t timeout){
uint8_t noByte = 0, i = 0, c = 0;
uint8_t brk = 1;
TA0CCR0 = N_Timer_s(2);
while(brk){
if(strstr((char*)rx_buffer,"OK")){
brk = 0;
}
else if(strstr((char*)rx_buffer,"ERROR")){
brk = 0;
}
else if(strstr((char*)rx_buffer,"DOWNLOAD"))brk = 0;
else if(strstr((char*)rx_buffer,"+HTTPACTION:")){
brk = 0;
}
else if(TA0R == TA0CCR0) {
brk = 0;
}
}
memset(g_resp.data,'\0',RX_BUFF_SIZE);
memset(rx_buffer,'\0',RX_BUFF_SIZE);
strcpy((char*)tx_buffer,(char*)(AT_MESSAGE(command_id)));
if(uart_write() == 0){
noByte = uart_readBytes(timeout);
for(i = 0, c = 0; i < noByte;i++){
if((rx_buffer[i] > 32) && (rx_buffer[i] <= 126) ){
g_resp.data[c] = rx_buffer[i];
c++;
}
}
g_resp.size = c;
}else{
//Tx buffer overflow
}
check_resp(command_id);
}
Thank you for your time.
