
please wait
|
|
rx_length = 1 rx_buffer = rx_length = 15 rx_buffer = HELLO_WORLD!! rx_length = 1 rx_buffer = ELLO_WORLD!! rx_length = 15 rx_buffer = HELLO_WORLD!! rx_length = 1 rx_buffer = ELLO_WORLD!! rx_length = 15 rx_buffer = HELLO_WORLD!! rx_length = 1 rx_buffer = ELLO_WORLD!! |
|
|
|
|
UART_rx.cpp: In function ‘int main(int, char**)’: UART_rx.cpp:80:70: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] if ( (num_of_characters_received < 16) && (&received_character == 'H') ) { UART_rx.cpp:81:48: error: invalid conversion from ‘unsigned char*’ to ‘unsigned char’ [-fpermissive] rx_buffer[num_of_characters_received] = &received_character; UART_rx.cpp:92:51: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] }while(rx_length = read(uart0_filestream, (void*)received_character, 1)); //Filestream, buffer to store in, number of bytes to read (max)); |
|
|
Why is "unsigned char received_character;" treated as pointer ? |
UART_rx.cpp: In function ‘int main(int, char**)’: UART_rx.cpp:80:70: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] if ( (num_of_characters_received < 16) && (&received_character == 'H') ) { |
UART_rx.cpp:92:51: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] }while(rx_length = read(uart0_filestream, (void*)received_character, 1)); //Filestream, buffer to store in, number of bytes to read (max)); |
|
|
rx_buffer = Hreceived_character = 48 rx_buffer = HEreceived_character = 45 rx_buffer = HELreceived_character = 4c rx_buffer = HELLreceived_character = 4c rx_buffer = HELLOreceived_character = 4f rx_buffer = HELLO_received_character = 5f rx_buffer = HELLO_Wreceived_character = 57 rx_buffer = HELLO_WOreceived_character = 4f rx_buffer = HELLO_WORreceived_character = 52 rx_buffer = HELLO_WORLreceived_character = 4c rx_buffer = HELLO_WORLDreceived_character = 44 rx_buffer = HELLO_WORLD!received_character = 21 rx_buffer = HELLO_WORLD!!received_character = 21 rx_buffer = HELLO_WORLD!! received_character = 20 rx_buffer = HELLO_WORLD!! received_character = a rx_buffer = HELLO_WORLD!! received_character = a UART_rx: UART_rx.cpp:95: int main(int, char**): Assertion `strcmp((const char*)rx_buffer, "HELLO_WORLD!! \r\n")==0' failed. Aborted (core dumped) |
|
|
line 16 seem like carriage return but it is printed as 'a' instead of 'd' |
|
|