Skip to content

Commit

Permalink
Update copyright dates and use upper case
Browse files Browse the repository at this point in the history
  • Loading branch information
xluciano committed Jun 25, 2024
1 parent ea94e2f commit f34943d
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 19 deletions.
19 changes: 9 additions & 10 deletions modules/sw_services/device_control/host/device_access_i2c_rpi.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2016-2023 XMOS LIMITED.
// Copyright 2016-2024 XMOS LIMITED.
// This Software is subject to the terms of the XMOS Public Licence: Version 1.
#if USE_I2C && RPI

Expand Down Expand Up @@ -40,13 +40,12 @@ control_ret_t control_init_i2c(unsigned char i2c_slave_address)

if ((fd = open(devName, O_RDWR)) < 0) { // Open port for reading and writing
PRINT_ERROR("Failed to open i2c port: ");
perror( "" );
return CONTROL_ERROR;
}

if (ioctl(fd, I2C_SLAVE, address) < 0) { // Set the port options and set the address of the device we wish to speak to
PRINT_ERROR("unable to set i2c configuration at address 0x%x: ", address);
perror( "" );
PRINT_ERROR("Unable to set i2c configuration at address 0x%x: ", address);
perror("Error :");
return CONTROL_ERROR;
}

Expand Down Expand Up @@ -95,7 +94,7 @@ control_write_command(control_resid_t resid, control_cmd_t cmd,
if(numbytes < 0)
{
PRINT_ERROR("I2C write() returned error %d\n",numbytes);
perror( "Error :" );
perror("Error :");
return CONTROL_ERROR;
}
else if(numbytes != len)
Expand All @@ -106,7 +105,7 @@ control_write_command(control_resid_t resid, control_cmd_t cmd,
if(numbytes < 0)
{
PRINT_ERROR("I2C read() returned error %d\n",numbytes);
perror( "Error :" );
perror("Error :");
return CONTROL_ERROR;
}

Expand Down Expand Up @@ -134,14 +133,14 @@ control_read_command(control_resid_t resid, control_cmd_t cmd,
{
len = control_build_i2c_data(read_hdr, resid, cmd, payload, payload_len);
if (len != 3){
PRINT_ERROR("building read command section of read_device failed. 'len' should be 3 but is %d\n", len);
PRINT_ERROR("Building read command section of read_device failed. 'len' should be 3 but is %d\n", len);
return CONTROL_ERROR;
}
}
#else
len = control_build_i2c_data(read_hdr, resid, cmd, payload, payload_len);
if (len != 3){
PRINT_ERROR("building read command section of read_device failed. 'len' should be 3 but is %d\n", len);
PRINT_ERROR("Building read command section of read_device failed. 'len' should be 3 but is %d\n", len);
return CONTROL_ERROR;
}
#endif
Expand Down Expand Up @@ -173,8 +172,8 @@ control_read_command(control_resid_t resid, control_cmd_t cmd,
int errno = ioctl( fd, I2C_RDWR, &rdwr_data );

if ( errno < 0 ) {
PRINT_ERROR("failed to transfer data, rdwr ioctl error number %d: ", errno );
perror( "Error :" );
PRINT_ERROR("Failed to transfer data, rdwr ioctl error number %d: ", errno );
perror("Error :");
return CONTROL_ERROR;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2017-2023 XMOS LIMITED.
// Copyright 2017-2024 XMOS LIMITED.
// This Software is subject to the terms of the XMOS Public Licence: Version 1.
#if USE_SPI && RPI

Expand Down
16 changes: 8 additions & 8 deletions modules/sw_services/device_control/host/device_access_usb.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2016-2023 XMOS LIMITED.
// Copyright 2016-2024 XMOS LIMITED.
// This Software is subject to the terms of the XMOS Public Licence: Version 1.
#if USE_USB
#include <stdio.h>
Expand Down Expand Up @@ -211,7 +211,7 @@ static control_ret_t find_xmos_device(int vendor_id, int product_id)
(dev->descriptor.idProduct == product_id)) {
devh = usb_open(dev);
if (!devh) {
PRINT_ERROR("failed to open device\n");
PRINT_ERROR("Failed to open device\n");
return CONTROL_ERROR;
}
break;
Expand All @@ -220,7 +220,7 @@ static control_ret_t find_xmos_device(int vendor_id, int product_id)
}

if (!devh) {
PRINT_ERROR("could not find device\n");
PRINT_ERROR("Could not find device\n");
return CONTROL_ERROR;
}

Expand All @@ -238,14 +238,14 @@ control_ret_t control_init_usb(int vendor_id, int product_id, int interface_num)

int r = usb_set_configuration(devh, 1);
if (r < 0) {
PRINT_ERROR("setting config 1\n");
PRINT_ERROR("Setting config 1\n");
usb_close(devh);
return CONTROL_ERROR;
}

r = usb_claim_interface(devh, interface_num);
if (r < 0) {
PRINT_ERROR("claiming interface %d %d\n", interface_num, r);
PRINT_ERROR("Claiming interface %d %d\n", interface_num, r);
return CONTROL_ERROR;
}

Expand All @@ -265,7 +265,7 @@ control_ret_t control_init_usb(int vendor_id, int product_id, int interface_num)
{
int ret = libusb_init(NULL);
if (ret < 0) {
PRINT_ERROR("failed to initialise libusb\n");
PRINT_ERROR("Failed to initialise libusb\n");
return CONTROL_ERROR;
}

Expand All @@ -283,12 +283,12 @@ control_ret_t control_init_usb(int vendor_id, int product_id, int interface_num)
}

if (dev == NULL) {
PRINT_ERROR("could not find device\n");
PRINT_ERROR("Could not find device\n");
return CONTROL_ERROR;
}

if (libusb_open(dev, &devh) < 0) {
PRINT_ERROR("failed to open device. Ensure adequate permissions\n");
PRINT_ERROR("Failed to open device. Ensure adequate permissions\n");
return CONTROL_ERROR;
}

Expand Down

0 comments on commit f34943d

Please sign in to comment.