[Armadeus-commitlog] armadeus branch, master, updated. armadeus-4.0-2594-g7c43fc0
Brought to you by:
sszy
|
From: Fabien M <fa...@us...> - 2011-12-01 08:33:17
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "armadeus".
The branch, master has been updated
via 7c43fc0dc9f9b2c6a4173b92d439c5031bd60731 (commit)
from f0001173855fa43e73efbb9733471a521a1dcaa2 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 7c43fc0dc9f9b2c6a4173b92d439c5031bd60731
Author: Fabien Marteau <fab...@ar...>
Date: Thu Dec 1 09:32:39 2011 +0100
[package][as_devices] Check if device pointer is NULL
-----------------------------------------------------------------------
Summary of changes:
target/packages/as_devices/c/as_adc.c | 42 ++++++++++++---
target/packages/as_devices/c/as_dac.c | 17 +++++-
target/packages/as_devices/c/as_gpio.c | 79 ++++++++++++++++++++++------
target/packages/as_devices/c/as_i2c.c | 50 ++++++++++++++++++
target/packages/as_devices/c/as_pwm.c | 89 ++++++++++++++++++++++++--------
target/packages/as_devices/c/as_spi.h | 2 +
6 files changed, 229 insertions(+), 50 deletions(-)
diff --git a/target/packages/as_devices/c/as_adc.c b/target/packages/as_devices/c/as_adc.c
index 9232600..2ca2be4 100644
--- a/target/packages/as_devices/c/as_adc.c
+++ b/target/packages/as_devices/c/as_adc.c
@@ -38,21 +38,37 @@
#undef ERROR
#define ERROR(fmt, ...) printf(fmt, ##__VA_ARGS__)
-struct as_adc_device *as_adc_open(const char *aAdcType, int aDeviceNum, int aVRef) {
- if (strncmp(AS_MAX1027_NAME, aAdcType, strlen(AS_MAX1027_NAME)) == 0)
+struct as_adc_device *as_adc_open(const char *aAdcType,
+ int aDeviceNum,
+ int aVRef) {
+ if (strncmp(AS_MAX1027_NAME,
+ aAdcType,
+ strlen(AS_MAX1027_NAME)) == 0)
return as_adc_open_max1027(aDeviceNum, aVRef);
- if (strncmp(AS_AS1531_NAME, aAdcType, strlen(AS_AS1531_NAME)) == 0)
+ if (strncmp(AS_AS1531_NAME,
+ aAdcType,
+ strlen(AS_AS1531_NAME)) == 0)
return as_adc_open_as1531(aDeviceNum, aVRef);
ERROR("Undefined ADC type '%s'\n",aAdcType);
return NULL;
}
-int32_t as_adc_get_value_in_millivolts(struct as_adc_device *aDev, int aChannel) {
- if (strncmp(AS_MAX1027_NAME, aDev->device_type, strlen(AS_MAX1027_NAME)) == 0)
+int32_t as_adc_get_value_in_millivolts(struct as_adc_device *aDev,
+ int aChannel) {
+ if (aDev == NULL) {
+ ERROR("Device is NULL\n");
+ return -1;
+ }
+
+ if (strncmp(AS_MAX1027_NAME,
+ aDev->device_type,
+ strlen(AS_MAX1027_NAME)) == 0)
return as_adc_get_value_in_millivolts_max1027(aDev, aChannel);
- if (strncmp(AS_AS1531_NAME, aDev->device_type, strlen(AS_AS1531_NAME)) == 0)
+ if (strncmp(AS_AS1531_NAME,
+ aDev->device_type,
+ strlen(AS_AS1531_NAME)) == 0)
return as_adc_get_value_in_millivolts_as1531(aDev, aChannel);
ERROR("Undefined ADC type '%s'\n", aDev->device_type);
@@ -61,12 +77,22 @@ int32_t as_adc_get_value_in_millivolts(struct as_adc_device *aDev, int aChannel)
int32_t as_adc_close(struct as_adc_device *aDev) {
int ret;
- if (strncmp(AS_MAX1027_NAME, aDev->device_type, strlen(AS_MAX1027_NAME)) == 0) {
+
+ if (aDev == NULL) {
+ ERROR("Device is NULL\n");
+ return -1;
+ }
+
+ if (strncmp(AS_MAX1027_NAME,
+ aDev->device_type,
+ strlen(AS_MAX1027_NAME)) == 0) {
ret = as_adc_close_max1027(aDev);
free(aDev);
return ret;
}
- if (strncmp(AS_AS1531_NAME, aDev->device_type, strlen(AS_AS1531_NAME)) == 0) {
+ if (strncmp(AS_AS1531_NAME,
+ aDev->device_type,
+ strlen(AS_AS1531_NAME)) == 0) {
ret = as_adc_close_as1531(aDev);
free(aDev);
return ret;
diff --git a/target/packages/as_devices/c/as_dac.c b/target/packages/as_devices/c/as_dac.c
index e492b0d..ab36e3d 100644
--- a/target/packages/as_devices/c/as_dac.c
+++ b/target/packages/as_devices/c/as_dac.c
@@ -44,9 +44,18 @@ int32_t as_dac_set_value_in_millivolts(struct as_dac_device *aDev,
int aChannel,
int aValue)
{
- if (strncmp(AS_MAX5821_TYPE, aDev->device_type, strlen(AS_MAX5821_TYPE)) == 0) {
+ if (aDev == NULL) {
+ ERROR("Device is NULL\n");
+ return -1;
+ }
+
+ if (strncmp(AS_MAX5821_TYPE,
+ aDev->device_type,
+ strlen(AS_MAX5821_TYPE)) == 0) {
if ((aChannel == 0) || (aChannel == 1))
- return as_dac_set_value_max5821(aDev, aChannel + 'A', aValue);
+ return as_dac_set_value_max5821(aDev,
+ aChannel + 'A',
+ aValue);
else {
ERROR("Wrong channel number %d\n",aChannel);
return -1;
@@ -60,7 +69,9 @@ int32_t as_dac_set_value_in_millivolts(struct as_dac_device *aDev,
int32_t as_dac_close(struct as_dac_device *aDev)
{
- if (strncmp(AS_MAX5821_TYPE, aDev->device_type, strlen(AS_MAX5821_TYPE)) == 0)
+ if (strncmp(AS_MAX5821_TYPE,
+ aDev->device_type,
+ strlen(AS_MAX5821_TYPE)) == 0)
as_dac_close_max5821(aDev);
free(aDev);
diff --git a/target/packages/as_devices/c/as_gpio.c b/target/packages/as_devices/c/as_gpio.c
index 9bf2b02..9e7748a 100644
--- a/target/packages/as_devices/c/as_gpio.c
+++ b/target/packages/as_devices/c/as_gpio.c
@@ -82,16 +82,21 @@ struct as_gpio_device *as_gpio_open(int aGpioNum)
/*------------------------------------------------------------------------------*/
-int32_t as_gpio_set_pin_direction(struct as_gpio_device *gpio_dev, char *direction)
+int32_t as_gpio_set_pin_direction(struct as_gpio_device *aDev, char *direction)
{
char buf[BUFF_SIZE];
int gpio_fd;
int ret = 0;
- snprintf(buf, BUFF_SIZE, "/sys/class/gpio/gpio%d/direction", gpio_dev->port_num);
+ if(aDev == NULL){
+ ERROR("device is NULL\n");
+ return -EINVAL;
+ }
+
+ snprintf(buf, BUFF_SIZE, "/sys/class/gpio/gpio%d/direction", aDev->port_num);
gpio_fd = open(buf, O_WRONLY);
if (gpio_fd < 0) {
- ERROR("Can't open gpio%d direction\n", gpio_dev->port_num);
+ ERROR("Can't open gpio%d direction\n", aDev->port_num);
return -EINVAL;
}
@@ -106,7 +111,7 @@ int32_t as_gpio_set_pin_direction(struct as_gpio_device *gpio_dev, char *directi
/*------------------------------------------------------------------------------*/
-const char* as_gpio_get_pin_direction(struct as_gpio_device *gpio_dev)
+const char* as_gpio_get_pin_direction(struct as_gpio_device *aDev)
{
char buf[BUFF_SIZE];
static char direction[4];
@@ -114,17 +119,22 @@ const char* as_gpio_get_pin_direction(struct as_gpio_device *gpio_dev)
int ret = 0;
static const char none[] = "??";
+ if(aDev == NULL){
+ ERROR("device is NULL\n");
+ return NULL;
+ }
+
snprintf(buf, sizeof(buf), "/sys/class/gpio/gpio%d/direction",
- gpio_dev->port_num);
+ aDev->port_num);
gpio_file = fopen(buf, "r");
if (!gpio_file) {
- ERROR("Can't open gpio%d direction\n", gpio_dev->port_num);
+ ERROR("Can't open gpio%d direction\n", aDev->port_num);
return none;
}
ret = fscanf(gpio_file, "%s", direction);
fclose(gpio_file);
if (ret < 0) {
- ERROR("Can't get gpio%d direction\n", gpio_dev->port_num);
+ ERROR("Can't get gpio%d direction\n", aDev->port_num);
return none;
}
@@ -139,6 +149,11 @@ int32_t as_gpio_set_pin_value(struct as_gpio_device *aDev, int aValue)
int pin_file;
int retval;
+ if(aDev == NULL){
+ ERROR("device is NULL\n");
+ return -1;
+ }
+
snprintf(buf, BUFF_SIZE, "/sys/class/gpio/gpio%d/value", aDev->port_num);
pin_file = open(buf, O_WRONLY);
if (pin_file < 0) {
@@ -166,6 +181,11 @@ int32_t as_gpio_get_pin_value(struct as_gpio_device *aDev)
int retval;
int value;
+ if(aDev == NULL){
+ ERROR("device is NULL\n");
+ return -1;
+ }
+
snprintf(buf, BUFF_SIZE, "/sys/class/gpio/gpio%d/value", aDev->port_num);
pin_file = open(buf, O_RDONLY);
if (pin_file < 0) {
@@ -186,7 +206,7 @@ int32_t as_gpio_get_pin_value(struct as_gpio_device *aDev)
/*------------------------------------------------------------------------------*/
-int32_t as_gpio_wait_event(struct as_gpio_device *gpio_dev, int delay_ms)
+int32_t as_gpio_wait_event(struct as_gpio_device *aDev, int delay_ms)
{
char gpio_sys_name[BUFF_SIZE];
int gpio_fd;
@@ -194,11 +214,16 @@ int32_t as_gpio_wait_event(struct as_gpio_device *gpio_dev, int delay_ms)
int ret;
char tmp[16];
+ if(aDev == NULL){
+ ERROR("device is NULL\n");
+ return -EINVAL;
+ }
+
snprintf(gpio_sys_name, BUFF_SIZE, "/sys/class/gpio/gpio%d/value",
- gpio_dev->port_num);
+ aDev->port_num);
gpio_fd = open(gpio_sys_name, O_RDONLY);
if (gpio_fd < 0) {
- ERROR("Can't open gpio%d value\n", gpio_dev->port_num);
+ ERROR("Can't open gpio%d value\n", aDev->port_num);
return -EINVAL;
}
@@ -221,7 +246,7 @@ int32_t as_gpio_wait_event(struct as_gpio_device *gpio_dev, int delay_ms)
/*------------------------------------------------------------------------------*/
-const char* as_gpio_get_irq_mode(struct as_gpio_device *gpio_dev)
+const char* as_gpio_get_irq_mode(struct as_gpio_device *aDev)
{
char buf[BUFF_SIZE];
static char mode[8];
@@ -229,16 +254,21 @@ const char* as_gpio_get_irq_mode(struct as_gpio_device *gpio_dev)
int ret = 0;
static const char unknown[] = "??";
- snprintf(buf, sizeof(buf), "/sys/class/gpio/gpio%d/edge", gpio_dev->port_num);
+ if(aDev == NULL){
+ ERROR("device is NULL\n");
+ return unknown;
+ }
+
+ snprintf(buf, sizeof(buf), "/sys/class/gpio/gpio%d/edge", aDev->port_num);
gpio_file = fopen(buf, "r");
if (!gpio_file) {
- ERROR("Can't open gpio%d edge\n", gpio_dev->port_num);
+ ERROR("Can't open gpio%d edge\n", aDev->port_num);
return unknown;
}
ret = fscanf(gpio_file, "%s", mode);
fclose(gpio_file);
if (ret < 0) {
- ERROR("Can't get gpio%d edge\n", gpio_dev->port_num);
+ ERROR("Can't get gpio%d edge\n", aDev->port_num);
return unknown;
}
@@ -247,16 +277,21 @@ const char* as_gpio_get_irq_mode(struct as_gpio_device *gpio_dev)
/*------------------------------------------------------------------------------*/
-int32_t as_gpio_set_irq_mode(struct as_gpio_device *gpio_dev, char *mode)
+int32_t as_gpio_set_irq_mode(struct as_gpio_device *aDev, char *mode)
{
char buf[BUFF_SIZE];
int gpio_fd;
int ret = 0;
- snprintf(buf, BUFF_SIZE, "/sys/class/gpio/gpio%d/edge", gpio_dev->port_num);
+ if(aDev == NULL){
+ ERROR("device is NULL\n");
+ return -EINVAL;
+ }
+
+ snprintf(buf, BUFF_SIZE, "/sys/class/gpio/gpio%d/edge", aDev->port_num);
gpio_fd = open(buf, O_WRONLY);
if (gpio_fd < 0) {
- ERROR("Can't open gpio%d edge\n", gpio_dev->port_num);
+ ERROR("Can't open gpio%d edge\n", aDev->port_num);
return -EINVAL;
}
@@ -273,6 +308,11 @@ int32_t as_gpio_set_irq_mode(struct as_gpio_device *gpio_dev, char *mode)
int32_t as_gpio_get_pin_num(struct as_gpio_device *aDev)
{
+ if(aDev == NULL){
+ ERROR("device is NULL\n");
+ return -1;
+ }
+
return aDev->port_num;
}
@@ -280,6 +320,11 @@ int32_t as_gpio_get_pin_num(struct as_gpio_device *aDev)
int32_t as_gpio_close(struct as_gpio_device *aDev)
{
+ if(aDev == NULL){
+ ERROR("device is NULL\n");
+ return -1;
+ }
+
return 0;
}
diff --git a/target/packages/as_devices/c/as_i2c.c b/target/packages/as_devices/c/as_i2c.c
index 9434f6f..8425274 100644
--- a/target/packages/as_devices/c/as_i2c.c
+++ b/target/packages/as_devices/c/as_i2c.c
@@ -67,6 +67,11 @@ struct as_i2c_device *as_i2c_open(int aBusNumber)
int32_t as_i2c_close(struct as_i2c_device *aDev)
{
+ if (aDev == NULL) {
+ ERROR("Device is NULL\n");
+ return -1;
+ }
+
close(aDev->fi2c);
free(aDev);
@@ -75,6 +80,11 @@ int32_t as_i2c_close(struct as_i2c_device *aDev)
int32_t as_i2c_set_slave_addr(struct as_i2c_device *aDev, uint8_t aAddr)
{
+ if (aDev == NULL) {
+ ERROR("Device is NULL\n");
+ return -1;
+ }
+
if (aAddr == 0) {
ERROR("Wrong slave address\n");
return -1;
@@ -89,6 +99,11 @@ int32_t as_i2c_set_slave_addr(struct as_i2c_device *aDev, uint8_t aAddr)
}
int32_t as_i2c_get_slave_addr(struct as_i2c_device *aDev) {
+ if (aDev == NULL) {
+ ERROR("Device is NULL\n");
+ return -1;
+ }
+
return aDev->slave_addr;
}
@@ -98,6 +113,11 @@ int32_t as_i2c_read(struct as_i2c_device *aDev,
struct i2c_msg msg = { aDev->slave_addr, I2C_M_RD, n, aData };
struct i2c_rdwr_ioctl_data rdwr = { &msg, 1 };
+ if (aDev == NULL) {
+ ERROR("Device is NULL\n");
+ return -1;
+ }
+
if (aDev->slave_addr == 0) {
ERROR("Slave address must be set before\n");
return -1;
@@ -119,6 +139,11 @@ int32_t as_i2c_write(struct as_i2c_device *aDev,
struct i2c_msg msg = { aDev->slave_addr, 0, n, (uint8_t *)aData };
struct i2c_rdwr_ioctl_data rdwr = { &msg, 1 };
+ if (aDev == NULL) {
+ ERROR("Device is NULL\n");
+ return -1;
+ }
+
if (aDev->slave_addr == 0) {
ERROR("Slave address must be set before\n");
return -1;
@@ -141,6 +166,11 @@ int32_t as_i2c_read_reg(struct as_i2c_device *aDev,
struct i2c_msg msg = { aDev->slave_addr, 0, 1, &aReg };
struct i2c_rdwr_ioctl_data rdwr = { &msg, 1 };
+ if (aDev == NULL) {
+ ERROR("Device is NULL\n");
+ return -1;
+ }
+
if (aDev->slave_addr == 0) {
ERROR("Slave address must be set before\n");
return -1;
@@ -173,6 +203,11 @@ int32_t as_i2c_write_reg(struct as_i2c_device *aDev,
{
uint8_t buf[n+1];
+ if (aDev == NULL) {
+ ERROR("Device is NULL\n");
+ return -1;
+ }
+
if (aDev->slave_addr == 0) {
ERROR("Slave address must be set before\n");
return -1;
@@ -193,6 +228,11 @@ int32_t as_i2c_read_reg_byte(struct as_i2c_device *aDev, uint8_t aReg)
uint8_t val;
int ret;
+ if (aDev == NULL) {
+ ERROR("Device is NULL\n");
+ return -1;
+ }
+
if (aDev->slave_addr == 0) {
ERROR("Slave address must be set before\n");
return -1;
@@ -209,6 +249,11 @@ int32_t as_i2c_write_reg_byte(struct as_i2c_device *aDev,
{
uint8_t buf[2] = { aReg, aVal };
+ if (aDev == NULL) {
+ ERROR("Device is NULL\n");
+ return -1;
+ }
+
if (aDev->slave_addr == 0) {
ERROR("Slave address must be set before\n");
return -1;
@@ -225,6 +270,11 @@ int32_t as_i2c_read_msg(struct as_i2c_device *aDev,
struct i2c_msg msg = { aDev->slave_addr, 0, aWriteSize, aWData };
struct i2c_rdwr_ioctl_data rdwr = { &msg, 1 };
+ if (aDev == NULL) {
+ ERROR("Device is NULL\n");
+ return -1;
+ }
+
if (aDev->slave_addr == 0) {
ERROR("Slave address must be set before\n");
return -1;
diff --git a/target/packages/as_devices/c/as_pwm.c b/target/packages/as_devices/c/as_pwm.c
index 787021c..c3c4b8e 100644
--- a/target/packages/as_devices/c/as_pwm.c
+++ b/target/packages/as_devices/c/as_pwm.c
@@ -79,19 +79,29 @@ struct as_pwm_device *as_pwm_open(int aPwmNumber)
/*------------------------------------------------------------------------------*/
-int32_t as_pwm_set_frequency(struct as_pwm_device *dev, int freq)
+int32_t as_pwm_set_frequency(struct as_pwm_device *aDev, int freq)
{
- return as_write_buffer(dev->fileFrequency, freq);
+ if (aDev == NULL) {
+ ERROR("Device is NULL\n");
+ return -1;
+ }
+
+ return as_write_buffer(aDev->fileFrequency, freq);
}
/*------------------------------------------------------------------------------*/
-int32_t as_pwm_get_frequency(struct as_pwm_device *dev)
+int32_t as_pwm_get_frequency(struct as_pwm_device *aDev)
{
char buffer[SIZE_OF_BUFF];
int ret;
- ret = as_read_buffer(dev->fileFrequency, buffer, SIZE_OF_BUFF);
+ if (aDev == NULL) {
+ ERROR("Device is NULL\n");
+ return -1;
+ }
+
+ ret = as_read_buffer(aDev->fileFrequency, buffer, SIZE_OF_BUFF);
if (ret < 0) {
ERROR("Can't read frequency\n");
return ret;
@@ -102,19 +112,29 @@ int32_t as_pwm_get_frequency(struct as_pwm_device *dev)
/*------------------------------------------------------------------------------*/
-int32_t as_pwm_set_period(struct as_pwm_device *dev, int period)
+int32_t as_pwm_set_period(struct as_pwm_device *aDev, int period)
{
- return as_write_buffer(dev->filePeriod, period);
+ if (aDev == NULL) {
+ ERROR("Device is NULL\n");
+ return -1;
+ }
+
+ return as_write_buffer(aDev->filePeriod, period);
}
/*------------------------------------------------------------------------------*/
-int32_t as_pwm_get_period(struct as_pwm_device *dev)
+int32_t as_pwm_get_period(struct as_pwm_device *aDev)
{
char buffer[SIZE_OF_BUFF];
int ret;
- ret = as_read_buffer(dev->filePeriod, buffer, SIZE_OF_BUFF);
+ if (aDev == NULL) {
+ ERROR("Device is NULL\n");
+ return -1;
+ }
+
+ ret = as_read_buffer(aDev->filePeriod, buffer, SIZE_OF_BUFF);
if (ret < 0) {
ERROR("Can't read period\n");
return ret;
@@ -125,19 +145,29 @@ int32_t as_pwm_get_period(struct as_pwm_device *dev)
/*------------------------------------------------------------------------------*/
-int32_t as_pwm_set_duty(struct as_pwm_device *dev, int duty)
+int32_t as_pwm_set_duty(struct as_pwm_device *aDev, int duty)
{
- return as_write_buffer(dev->fileDuty, duty);
+ if (aDev == NULL) {
+ ERROR("Device is NULL\n");
+ return -1;
+ }
+
+ return as_write_buffer(aDev->fileDuty, duty);
}
/*------------------------------------------------------------------------------*/
-int32_t as_pwm_get_duty(struct as_pwm_device *dev)
+int32_t as_pwm_get_duty(struct as_pwm_device *aDev)
{
char buffer[SIZE_OF_BUFF];
int ret;
- ret = as_read_buffer(dev->fileDuty, buffer, SIZE_OF_BUFF);
+ if (aDev == NULL) {
+ ERROR("Device is NULL\n");
+ return -1;
+ }
+
+ ret = as_read_buffer(aDev->fileDuty, buffer, SIZE_OF_BUFF);
if (ret < 0) {
ERROR("Can't read duty\n");
return ret;
@@ -148,14 +178,19 @@ int32_t as_pwm_get_duty(struct as_pwm_device *dev)
/*------------------------------------------------------------------------------*/
-int32_t as_pwm_set_state(struct as_pwm_device *pwm_dev, int enable)
+int32_t as_pwm_set_state(struct as_pwm_device *aDev, int enable)
{
int ret = 0;
+ if (aDev == NULL) {
+ ERROR("Device is NULL\n");
+ return -1;
+ }
+
if (enable) {
- ret = as_write_buffer(pwm_dev->fileActive, 1);
+ ret = as_write_buffer(aDev->fileActive, 1);
} else {
- ret = as_write_buffer(pwm_dev->fileActive, 0);
+ ret = as_write_buffer(aDev->fileActive, 0);
}
if (ret < 0) {
ERROR("Can't write to pwmX/active\n");
@@ -166,12 +201,17 @@ int32_t as_pwm_set_state(struct as_pwm_device *pwm_dev, int enable)
/*------------------------------------------------------------------------------*/
-int32_t as_pwm_get_state(struct as_pwm_device *dev)
+int32_t as_pwm_get_state(struct as_pwm_device *aDev)
{
char buffer[SIZE_OF_BUFF];
int ret;
- ret = as_read_buffer(dev->fileActive, buffer, SIZE_OF_BUFF);
+ if (aDev == NULL) {
+ ERROR("Device is NULL\n");
+ return -1;
+ }
+
+ ret = as_read_buffer(aDev->fileActive, buffer, SIZE_OF_BUFF);
if (ret < 0) {
ERROR("Can't read state\n");
return ret;
@@ -182,27 +222,32 @@ int32_t as_pwm_get_state(struct as_pwm_device *dev)
/*------------------------------------------------------------------------------*/
-int32_t as_pwm_close(struct as_pwm_device *dev)
+int32_t as_pwm_close(struct as_pwm_device *aDev)
{
int ret = 0;
+ if (aDev == NULL) {
+ ERROR("Device is NULL\n");
+ return -1;
+ }
+
/* Close pwm management files */
- ret = close(dev->fileFrequency);
+ ret = close(aDev->fileFrequency);
if (ret < 0) {
ERROR("Can't close /frequency");
return ret;
}
- ret = close(dev->filePeriod);
+ ret = close(aDev->filePeriod);
if (ret < 0) {
ERROR("Can't close /period");
return ret;
}
- ret = close(dev->fileDuty);
+ ret = close(aDev->fileDuty);
if (ret < 0) {
ERROR("Can't close /duty");
return ret;
}
- ret = close(dev->fileActive);
+ ret = close(aDev->fileActive);
if (ret < 0) {
ERROR("Can't close /active");
return ret;
diff --git a/target/packages/as_devices/c/as_spi.h b/target/packages/as_devices/c/as_spi.h
index 99907ee..ceb84fe 100644
--- a/target/packages/as_devices/c/as_spi.h
+++ b/target/packages/as_devices/c/as_spi.h
@@ -16,6 +16,8 @@
*
* Copyright (C) 2009 Fabien Marteau <fab...@ar...>
*
+ * TODO:
+ * - use a device structure instead of int fd.
*/
hooks/post-receive
--
armadeus
|