static void read_mouse_and_send(void) { //lint -save -e514 Unusual use of a boolean expression (use of &= assignment). bool mouse_send_ok; // If the "mouse sensor" has data ready for read-out. if(mouse_sensor_data_is_ready()) { uint8_t mouse_packet[NRFR_MOUSE_MOV_PACKET_LENGTH]; // Get packet from "mouse sensor". if(mouse_sensor_read(mouse_packet)) { // Wait in case the FIFOs are full. while(!nrf_gzll_ok_to_add_packet_to_tx_fifo(NRFR_MOUSE_EP)) {} // Add mouse packet to the mouse pipe's TX FIFO. mouse_send_ok = nrf_gzll_add_packet_to_tx_fifo(NRFR_MOUSE_EP, mouse_packet, NRFR_MOUSE_MOV_PACKET_LENGTH); if(!mouse_send_ok) { /* Adding packet to the TX FIFO failed. Use nrf_gzll_get_error_code() to investigate the cause. */ } } } //lint -restore }
static void read_mouse_and_send(void) { //lint -save -e514 Unusual use of a boolean expression (use of &= assignment). bool mouse_send_ok; // If the "mouse sensor" has data ready for read-out. if(mouse_sensor_data_is_ready()) { uint8_t mouse_packet[NRFR_MOUSE_MOV_PACKET_LENGTH]; // Get packet from "mouse sensor". if(mouse_sensor_read(mouse_packet)) { // Wait in case the FIFOs are full. while(!nrf_gzll_ok_to_add_packet_to_tx_fifo(NRFR_MOUSE_EP)) {} // Add mouse packet to the mouse pipe's TX FIFO. mouse_send_ok = nrf_gzll_add_packet_to_tx_fifo(NRFR_MOUSE_EP, mouse_packet, NRFR_MOUSE_MOV_PACKET_LENGTH); if (mouse_send_ok) { printf("Mouse sent OK\n"); } else { printf("Mouse sent FAILED\n"); } } } //lint -restore }