Ehlo.
Siedze i oblatuje sie w subj. Nie powiem, rezultaty calkiem znosne, ale poleglem w pewnym miejscu, mianowicie stringi. Chcialbym napisac sobie procedurke wysylajaca stringa na LCD. I teraz nie bardzo wiem jak to zrobic, bo w GCC chyba nie ma takiego typu zmiennej, co prawda po glowie mi sie kolacze ze string 19 znakowy to nic innego jak np. char a[20] zakonczony zerem. Rzuccie jakims przykladem jak przekazac do procedurki stringa... bo jak nie... ;-))) Na powaznie, poprosze krotki przyklad (najlepiej dzialajacy) typu:
char lcd_send_string (char a[20]) { for (unsigned char f=1;f<strlen(a);f++) lcd_send_ascii(a[f]); return(0); }
int main (void) lcd_send_string ('Hello world');
PS. A propo's ostatniej dyskusji o promowaniu char-a do 16 bitowego integera. Odpowiedz jest w dokumentacji. ========================================================
7.3.21 Why does the compiler compile an 8-bit operation that uses bitwise oper-ators into a 16-bit operation in assembly? Bitwise operations in Standard C will automatically promote their operands to an int, which is (by default) 16 bits in avr-gcc. To work around this use typecasts on the operands, including literals, to declare that the values are to be 8 bit operands. This may be especially important when clearing a bit: var &= mask; /* wrong way! The bitwise not operator ( . ) will also promote the value in mask to an int. To keep it an 8-bit value, typecast before the not operator: var &= (unsigned char)mask; ========================================================PS2. Pewnie o stringach tez jest... ale cos nie moge znalezc... ghrrr. Z gory dzieki.