mirror of
https://github.com/Lorenzooone/cc3dsfs.git
synced 2026-10-01 19:36:36 -05:00
Small warning fixes to partner ctr code
This commit is contained in:
@@ -265,8 +265,8 @@ static bool get_is_pos_first_synch_in_buffer(uint8_t* buffer, size_t pos_to_chec
|
||||
return (base_command.magic == SYNCH_VALUE_PARTNER_CTR) && (base_command.command == PARTNER_CTR_CAPTURE_COMMAND_INPUT);
|
||||
}
|
||||
|
||||
static size_t get_pos_first_synch_in_buffer(uint8_t* buffer, int start_pos) {
|
||||
for(int i = start_pos; i < (SINGLE_RING_BUFFER_SLICE_SIZE / 2); i++) {
|
||||
static size_t get_pos_first_synch_in_buffer(uint8_t* buffer, size_t start_pos) {
|
||||
for(size_t i = start_pos; i < (SINGLE_RING_BUFFER_SLICE_SIZE / 2); i++) {
|
||||
if(get_is_pos_first_synch_in_buffer(buffer, i * 2))
|
||||
return i * 2;
|
||||
}
|
||||
@@ -318,7 +318,7 @@ static void cypress_output_to_thread(CaptureData* capture_data, uint8_t *buffer_
|
||||
|
||||
static bool cypress_device_read_frame_not_synchronized(CypressPartnerCTRDeviceCaptureReceivedData* cypress_device_capture_recv_data, int &error) {
|
||||
volatile int first_slice_to_check = *cypress_device_capture_recv_data->first_usable_ring_buffer_slice_index;
|
||||
volatile int first_slice_pos_to_check = *cypress_device_capture_recv_data->last_used_ring_buffer_slice_pos;
|
||||
volatile int first_slice_pos_to_check = (int)*cypress_device_capture_recv_data->last_used_ring_buffer_slice_pos;
|
||||
bool found = false;
|
||||
// Determine which buffer is the first which needs to still be checked
|
||||
for(int i = 0; i < NUM_PARTNER_CTR_CYPRESS_CONCURRENTLY_RUNNING_BUFFERS; i++) {
|
||||
@@ -438,7 +438,6 @@ static bool is_valid_frame_partner_ctr(uint8_t* data, size_t slice_index, size_t
|
||||
size_t second_screen_pos = 0;
|
||||
size_t third_screen_pos = 0;
|
||||
size_t top_screen_pos = 0;
|
||||
PartnerCTRCaptureCommand top_command;
|
||||
out_end_pos = 0;
|
||||
|
||||
first_screen_pos = find_pos_partner_ctr_x_screen(data, slice_index, start_pos, 0, available_bytes);
|
||||
|
||||
@@ -105,12 +105,12 @@ std::string read_serial_ctr_capture(cy_device_device_handlers* handlers, const c
|
||||
|
||||
static int send_partner_ctr_packet(cy_device_device_handlers* handlers, const cypart_device_usb_device* device, const uint8_t* data, size_t size_data, int &transferred) {
|
||||
cypress_pipe_reset_ctrl_bulk_out(handlers, get_cy_usb_info(device));
|
||||
return cypress_ctrl_bulk_out_transfer(handlers, get_cy_usb_info(device), data, size_data, &transferred);
|
||||
return cypress_ctrl_bulk_out_transfer(handlers, get_cy_usb_info(device), data, (int)size_data, &transferred);
|
||||
}
|
||||
|
||||
static int recv_partner_ctr_packet(cy_device_device_handlers* handlers, const cypart_device_usb_device* device, uint8_t* data, size_t size_data, int &transferred) {
|
||||
cypress_pipe_reset_ctrl_bulk_in(handlers, get_cy_usb_info(device));
|
||||
return cypress_ctrl_bulk_in_transfer(handlers, get_cy_usb_info(device), data, size_data, &transferred);
|
||||
return cypress_ctrl_bulk_in_transfer(handlers, get_cy_usb_info(device), data, (int)size_data, &transferred);
|
||||
}
|
||||
|
||||
// Name is tentative, based on pattern observed in wireshark packets...
|
||||
@@ -144,9 +144,9 @@ static int read_write_generic_data_from_to_address_partner_ctr(cy_device_device_
|
||||
int num_iters = (int)(data_size / max_size);
|
||||
for(int i = 0; i < num_iters; i++) {
|
||||
if(is_write)
|
||||
ret = write_to_address_partner_ctr(handlers, device, address + curr_pos, data + curr_pos, max_size, data_size_byte);
|
||||
ret = write_to_address_partner_ctr(handlers, device, (uint32_t)(address + curr_pos), data + curr_pos, max_size, data_size_byte);
|
||||
else
|
||||
ret = read_from_address_partner_ctr(handlers, device, address + curr_pos, data + curr_pos, max_size, data_size_byte);
|
||||
ret = read_from_address_partner_ctr(handlers, device, (uint32_t)(address + curr_pos), data + curr_pos, max_size, data_size_byte);
|
||||
if(ret < 0)
|
||||
return ret;
|
||||
data_size -= max_size;
|
||||
|
||||
Reference in New Issue
Block a user