DexterLB
New Member
So, i've been making a program for PIC12F629 in mikroC. Yesterday i finished my soft_usart_putstr function (sends a char* through uart). Here's the code:
. But I have only 64 bytes of ram, and only 30 of them are free. So if I do:
I am out of ram because each symbol is a byte. I tried to make a second function like that, especially for constant strings as the above, with "const char* str" instead of "char* str" as a parameter, but strlen() does not accept it. Do I have to take a second parameter "length" or I can do it in a better way? Thanks in advance!
Code:
void soft_usart_putstr ( char* str )
{
int i = 0;
int len = strlen ( str );
do {
soft_usart_putch ( str[i] );
i++;
} while ( i <= len );
}
Code:
soft_usart_putstr ( "Hello! Press ENTER to continue \n");