debug: Reduce CONFIG_CPP_HAVE_VARARGS usage

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
Xiang Xiao
2020-05-04 18:55:11 +08:00
committed by patacongo
parent 6604cdb3f2
commit d9d2fc0d0a
24 changed files with 387 additions and 1179 deletions
@@ -116,19 +116,11 @@
/* Debug ********************************************************************/ /* Debug ********************************************************************/
#ifdef CONFIG_CPP_HAVE_VARARGS
# ifdef CONFIG_DEBUG_INFO
# define message(...) _info(__VA_ARGS__)
# else
# define message(...) syslog(LOG_INFO, __VA_ARGS__)
# endif
#else
#ifdef CONFIG_DEBUG_INFO #ifdef CONFIG_DEBUG_INFO
# define message _info # define message _info
#else #else
# define message _err # define message _err
#endif #endif
#endif
/**************************************************************************** /****************************************************************************
* Public Functions * Public Functions
@@ -186,7 +178,7 @@ int board_app_initialize(uintptr_t arg)
CONFIG_NSH_MMCSDSLOTNO, spi); CONFIG_NSH_MMCSDSLOTNO, spi);
if (ret < 0) if (ret < 0)
{ {
message("board_app_initialize: Failed to bind SPI port %d to MMC/SD slot %d: %d\n", message("Failed to bind SPI port %d to MMC/SD slot %d: %d\n",
CONFIG_NSH_MMCSDSPIPORTNO, CONFIG_NSH_MMCSDSLOTNO, ret); CONFIG_NSH_MMCSDSPIPORTNO, CONFIG_NSH_MMCSDSLOTNO, ret);
return ret; return ret;
} }
+7 -11
View File
@@ -82,13 +82,8 @@
# define baterr _err # define baterr _err
# define batreg _err # define batreg _err
#else #else
# ifdef CONFIG_CPP_HAVE_VARARGS # define baterr _none
# define baterr(x...) # define batreg _none
# define batreg(x...)
# else
# define baterr (void)
# define batreg (void)
# endif
#endif #endif
/**************************************************************************** /****************************************************************************
@@ -636,7 +631,8 @@ static inline int bq2425x_setvolt(FAR struct bq2425x_dev_s *priv, int volts)
* *
****************************************************************************/ ****************************************************************************/
static inline int bq2425x_setcurr(FAR struct bq2425x_dev_s *priv, int current) static inline int bq2425x_setcurr(FAR struct bq2425x_dev_s *priv,
int current)
{ {
uint8_t regval; uint8_t regval;
int idx; int idx;
@@ -744,7 +740,7 @@ static int bq2425x_input_current(FAR struct battery_charger_dev_s *dev,
ret = bq2425x_powersupply(priv, value); ret = bq2425x_powersupply(priv, value);
if (ret < 0) if (ret < 0)
{ {
baterr("ERROR: Failed to set BQ2425x power supply input limit: %d\n", ret); baterr("ERROR: Failed to set BQ2425x power supply: %d\n", ret);
return ret; return ret;
} }
@@ -804,7 +800,7 @@ FAR struct battery_charger_dev_s *
/* Initialize the BQ2425x device structure */ /* Initialize the BQ2425x device structure */
priv = (FAR struct bq2425x_dev_s *)kmm_zalloc(sizeof(struct bq2425x_dev_s)); priv = kmm_zalloc(sizeof(struct bq2425x_dev_s));
if (priv) if (priv)
{ {
/* Initialize the BQ2425x device structure */ /* Initialize the BQ2425x device structure */
@@ -840,7 +836,7 @@ FAR struct battery_charger_dev_s *
ret = bq2425x_powersupply(priv, current); ret = bq2425x_powersupply(priv, current);
if (ret < 0) if (ret < 0)
{ {
baterr("ERROR: Failed to set BQ2425x power supply input limit: %d\n", ret); baterr("ERROR: Failed to set BQ2425x power supply: %d\n", ret);
kmm_free(priv); kmm_free(priv);
return NULL; return NULL;
} }
+26 -30
View File
@@ -103,15 +103,9 @@
# define batdbg _info # define batdbg _info
# define batinfo _info # define batinfo _info
#else #else
# ifdef CONFIG_CPP_HAVE_VARARGS # define baterr _none
# define baterr(x...) # define batdbg _none
# define batdbg(x...) # define batinfo _none
# define batinfo(x...)
# else
# define baterr (void)
# define batdbg (void)
# define batinfo(void)
# endif
#endif #endif
/**************************************************************************** /****************************************************************************
@@ -152,8 +146,7 @@ static int bq2429x_en_stat(FAR struct bq2429x_dev_s *priv, bool state);
static int bq2429x_setboost_otg_config(FAR struct bq2429x_dev_s *priv, static int bq2429x_setboost_otg_config(FAR struct bq2429x_dev_s *priv,
bool state); bool state);
static int bq2429x_powersupply(FAR struct bq2429x_dev_s *priv, int current); static int bq2429x_powersupply(FAR struct bq2429x_dev_s *priv, int current);
static inline int bq2429x_setvolt(FAR struct bq2429x_dev_s *priv, static int bq2429x_setvolt(FAR struct bq2429x_dev_s *priv, int volts);
int volts);
static inline int bq2429x_setcurr(FAR struct bq2429x_dev_s *priv, static inline int bq2429x_setcurr(FAR struct bq2429x_dev_s *priv,
int req_current); int req_current);
@@ -388,7 +381,7 @@ static int bq2429x_watchdog(FAR struct bq2429x_dev_s *priv, bool enable)
/* Hw Default is 40Sec so use that for time being */ /* Hw Default is 40Sec so use that for time being */
regval &= ~(BQ2429XR5_WATCHDOG_MASK); regval &= ~(BQ2429XR5_WATCHDOG_MASK);
regval |= BQ2429XR5_WATCHDOG_040Sec; regval |= BQ2429XR5_WATCHDOG_040SEC;
} }
else else
{ {
@@ -455,7 +448,7 @@ static int bq2429x_syson(FAR struct bq2429x_dev_s *priv)
* *
* Description: * Description:
* Enable charger termination. When termination is disabled, there are no * Enable charger termination. When termination is disabled, there are no
* indications of the charger terminating (i.e. STAT pin or STAT registers). * indications of the charger terminating (i.e. STAT pin or registers).
* *
****************************************************************************/ ****************************************************************************/
@@ -499,7 +492,8 @@ static int bq2429x_en_term(FAR struct bq2429x_dev_s *priv, bool state)
* Name: bq2429x_en_hiz * Name: bq2429x_en_hiz
* *
* Description: * Description:
* Enable high-impedance mode. Sets the charger IC into low power standby mode. * Enable high-impedance mode. Sets the charger IC into low power standby
* mode.
* *
****************************************************************************/ ****************************************************************************/
@@ -848,40 +842,40 @@ static int bq2429x_powersupply(FAR struct bq2429x_dev_s *priv, int current)
switch (current) switch (current)
{ {
case 100: case 100:
idx = BQ2429XR0_INLIM_0100mA; idx = BQ2429XR0_INLIM_0100MA;
break; break;
case 150: case 150:
idx = BQ2429XR0_INLIM_0150mA; idx = BQ2429XR0_INLIM_0150MA;
break; break;
case 500: case 500:
idx = BQ2429XR0_INLIM_0500mA; idx = BQ2429XR0_INLIM_0500MA;
break; break;
case 900: case 900:
idx = BQ2429XR0_INLIM_0900mA; idx = BQ2429XR0_INLIM_0900MA;
break; break;
case 1000: case 1000:
idx = BQ2429XR0_INLIM_1000mA; idx = BQ2429XR0_INLIM_1000MA;
break; break;
case 1500: case 1500:
idx = BQ2429XR0_INLIM_1500mA; idx = BQ2429XR0_INLIM_1500MA;
break; break;
case 2000: case 2000:
idx = BQ2429XR0_INLIM_2000mA; idx = BQ2429XR0_INLIM_2000MA;
break; break;
case 3000: case 3000:
idx = BQ2429XR0_INLIM_3000mA; idx = BQ2429XR0_INLIM_3000MA;
break; break;
default: default:
baterr("ERROR: Current not supported, setting default to 100mA.!\n"); baterr("ERROR: Current not supported, setting default to 100mA.!\n");
idx = BQ2429XR0_INLIM_0100mA; idx = BQ2429XR0_INLIM_0100MA;
break; break;
} }
@@ -917,7 +911,7 @@ static int bq2429x_powersupply(FAR struct bq2429x_dev_s *priv, int current)
* *
****************************************************************************/ ****************************************************************************/
static inline int bq2429x_setvolt(FAR struct bq2429x_dev_s *priv, int req_volts) static int bq2429x_setvolt(FAR struct bq2429x_dev_s *priv, int req_volts)
{ {
uint8_t regval; uint8_t regval;
int idx; int idx;
@@ -1129,8 +1123,9 @@ static int bq2429x_input_current(FAR struct battery_charger_dev_s *dev,
* *
* Description: * Description:
* Do miscellaneous battery operation. There are numerous options that are * Do miscellaneous battery operation. There are numerous options that are
* configurable on the bq2429x that go beyond what the NuttX battery charger * configurable on the bq2429x that go beyond what the NuttX battery
* API provide access to. This operate() function allows changing some of them. * charger API provide access to. This operate() function allows changing
* some of them.
* *
* REG00 EN_HIZ * REG00 EN_HIZ
* REG01[1] BOOST_LIM 1A/1.5A Default:1.5A * REG01[1] BOOST_LIM 1A/1.5A Default:1.5A
@@ -1168,7 +1163,8 @@ static int bq2429x_operate(FAR struct battery_charger_dev_s *dev,
uintptr_t param) uintptr_t param)
{ {
FAR struct bq2429x_dev_s *priv = (FAR struct bq2429x_dev_s *)dev; FAR struct bq2429x_dev_s *priv = (FAR struct bq2429x_dev_s *)dev;
FAR struct batio_operate_msg_s *msg = (FAR struct batio_operate_msg_s *)param; FAR struct batio_operate_msg_s *msg =
(FAR struct batio_operate_msg_s *)param;
int op; int op;
int value; int value;
int ret = OK; int ret = OK;
@@ -1194,7 +1190,7 @@ static int bq2429x_operate(FAR struct battery_charger_dev_s *dev,
case BATIO_OPRTN_HIZ: case BATIO_OPRTN_HIZ:
ret = bq2429x_en_hiz(priv, (bool)value); ret = bq2429x_en_hiz(priv, (bool)value);
/* Also need to set to 100mA USB host and if the battery above Vbatgd? */ /* Also need to set to 100mA USB host if the battery above Vbatgd? */
break; break;
@@ -1258,7 +1254,7 @@ FAR struct battery_charger_dev_s *
/* Initialize the BQ2429x device structure */ /* Initialize the BQ2429x device structure */
priv = (FAR struct bq2429x_dev_s *)kmm_zalloc(sizeof(struct bq2429x_dev_s)); priv = kmm_zalloc(sizeof(struct bq2429x_dev_s));
if (priv) if (priv)
{ {
/* Initialize the BQ2429x device structure */ /* Initialize the BQ2429x device structure */
@@ -1294,7 +1290,7 @@ FAR struct battery_charger_dev_s *
ret = bq2429x_powersupply(priv, current); ret = bq2429x_powersupply(priv, current);
if (ret < 0) if (ret < 0)
{ {
baterr("ERROR: Failed to set BQ2429x power supply input limit: %d\n", ret); baterr("ERROR: Failed to set BQ2429x power supply: %d\n", ret);
kmm_free(priv); kmm_free(priv);
return NULL; return NULL;
} }
+36 -43
View File
@@ -83,15 +83,9 @@
# define batreg _err # define batreg _err
# define batinfo _info # define batinfo _info
#else #else
# ifdef CONFIG_CPP_HAVE_VARARGS # define baterr _none
# define baterr(x...) # define batreg _none
# define batreg(x...) # define batinfo _none
# define batinfo(x...)
# else
# define baterr(void)
# define batreg(void)
# define batinfo(void)
# endif
#endif #endif
/**************************************************************************** /****************************************************************************
@@ -255,26 +249,25 @@ static int bq769x0_getnreg16(FAR struct bq769x0_dev_s *priv, uint8_t regaddr,
/* Device functions */ /* Device functions */
static inline int bq769x0_getreport(FAR struct bq769x0_dev_s *priv, static int bq769x0_getreport(FAR struct bq769x0_dev_s *priv,
FAR uint8_t *report); FAR uint8_t *report);
static inline int bq769x0_getvolt(FAR struct bq769x0_dev_s *priv, static int bq769x0_getvolt(FAR struct bq769x0_dev_s *priv, FAR int *volts);
FAR int *volts); static int bq769x0_getcurrent(FAR struct bq769x0_dev_s *priv,
static inline int bq769x0_getcurrent(FAR struct bq769x0_dev_s *priv,
FAR struct battery_monitor_current_s *current); FAR struct battery_monitor_current_s *current);
static inline int bq769x0_getcellvolt(FAR struct bq769x0_dev_s *priv, static int bq769x0_getcellvolt(FAR struct bq769x0_dev_s *priv,
FAR struct battery_monitor_voltage_s *voltages); FAR struct battery_monitor_voltage_s *voltages);
static inline int bq769x0_gettemperature(FAR struct bq769x0_dev_s *priv, static int bq769x0_gettemperature(FAR struct bq769x0_dev_s *priv,
FAR struct battery_monitor_temperature_s *temps); FAR struct battery_monitor_temperature_s *temps);
static inline int bq769x0_setbalance(FAR struct bq769x0_dev_s *priv, static int bq769x0_setbalance(FAR struct bq769x0_dev_s *priv,
FAR struct battery_monitor_balance_s *bal); FAR struct battery_monitor_balance_s *bal);
static inline int bq769x0_doshutdown(FAR struct bq769x0_dev_s *priv); static int bq769x0_doshutdown(FAR struct bq769x0_dev_s *priv);
static inline int bq769x0_setlimits(FAR struct bq769x0_dev_s *priv, static int bq769x0_setlimits(FAR struct bq769x0_dev_s *priv,
FAR struct battery_monitor_limits_s *limits); FAR struct battery_monitor_limits_s *limits);
static inline int bq769x0_setchgdsg(FAR struct bq769x0_dev_s *priv, static int bq769x0_setchgdsg(FAR struct bq769x0_dev_s *priv,
FAR struct battery_monitor_switches_s *sw); FAR struct battery_monitor_switches_s *sw);
static inline int bq769x0_clear_chipfaults(FAR struct bq769x0_dev_s *priv, static int bq769x0_clear_chipfaults(FAR struct bq769x0_dev_s *priv,
uint8_t faults); uint8_t faults);
static inline int bq769x0_updategain(FAR struct bq769x0_dev_s *priv); static int bq769x0_updategain(FAR struct bq769x0_dev_s *priv);
static int bq769x0_chip_cellcount(FAR struct bq769x0_dev_s *priv); static int bq769x0_chip_cellcount(FAR struct bq769x0_dev_s *priv);
/* Battery driver lower half methods */ /* Battery driver lower half methods */
@@ -368,7 +361,7 @@ static int bq769x0_getreg8(FAR struct bq769x0_dev_s *priv, uint8_t regaddr,
return ret; return ret;
} }
/* Our expected data length varies depending on whether or not a CRC is used */ /* Our expected data length varies depending on whetherCRC is used */
if (priv->crc) if (priv->crc)
{ {
@@ -441,7 +434,7 @@ static int bq769x0_putreg8(FAR struct bq769x0_dev_s *priv, uint8_t regaddr,
buffer[0] = regaddr; buffer[0] = regaddr;
buffer[1] = regval; buffer[1] = regval;
/* Our expected data length varies depending on whether or not a CRC is used */ /* Our expected data length varies depending on whether CRC is used */
if (priv->crc) if (priv->crc)
{ {
@@ -540,7 +533,7 @@ static int bq769x0_getnreg16(FAR struct bq769x0_dev_s *priv, uint8_t regaddr,
byte_count = 2 * count; byte_count = 2 * count;
/* Our expected I2C data length varies depending on whether or not a CRC is used */ /* Our expected I2C data length varies depending on whether CRC is used */
if (priv->crc) if (priv->crc)
{ {
@@ -614,8 +607,8 @@ static int bq769x0_getnreg16(FAR struct bq769x0_dev_s *priv, uint8_t regaddr,
* *
****************************************************************************/ ****************************************************************************/
static inline int bq769x0_getreport(FAR struct bq769x0_dev_s *priv, static int bq769x0_getreport(FAR struct bq769x0_dev_s *priv,
uint8_t *report) FAR uint8_t *report)
{ {
uint8_t regval = 0; uint8_t regval = 0;
int ret; int ret;
@@ -638,7 +631,7 @@ static inline int bq769x0_getreport(FAR struct bq769x0_dev_s *priv,
* *
****************************************************************************/ ****************************************************************************/
static inline int bq769x0_updategain(FAR struct bq769x0_dev_s *priv) static int bq769x0_updategain(FAR struct bq769x0_dev_s *priv)
{ {
int ret; int ret;
uint8_t gainreg1; uint8_t gainreg1;
@@ -696,7 +689,7 @@ static inline int bq769x0_updategain(FAR struct bq769x0_dev_s *priv)
* *
****************************************************************************/ ****************************************************************************/
static inline int bq769x0_doshutdown(FAR struct bq769x0_dev_s *priv) static int bq769x0_doshutdown(FAR struct bq769x0_dev_s *priv)
{ {
int ret; int ret;
uint8_t regval; uint8_t regval;
@@ -763,8 +756,8 @@ static inline int bq769x0_doshutdown(FAR struct bq769x0_dev_s *priv)
* *
****************************************************************************/ ****************************************************************************/
static inline int bq769x0_setlimits(FAR struct bq769x0_dev_s *priv, static int bq769x0_setlimits(FAR struct bq769x0_dev_s *priv,
struct battery_monitor_limits_s *limits) FAR struct battery_monitor_limits_s *limits)
{ {
int ret; int ret;
int i; int i;
@@ -1203,8 +1196,8 @@ static inline int bq769x0_setlimits(FAR struct bq769x0_dev_s *priv,
* *
****************************************************************************/ ****************************************************************************/
static inline int bq769x0_setchgdsg(FAR struct bq769x0_dev_s *priv, static int bq769x0_setchgdsg(FAR struct bq769x0_dev_s *priv,
struct battery_monitor_switches_s *sw) FAR struct battery_monitor_switches_s *sw)
{ {
int ret; int ret;
uint8_t regval; uint8_t regval;
@@ -1257,7 +1250,7 @@ static inline int bq769x0_setchgdsg(FAR struct bq769x0_dev_s *priv,
* *
****************************************************************************/ ****************************************************************************/
static inline int bq769x0_clear_chipfaults(FAR struct bq769x0_dev_s *priv, static int bq769x0_clear_chipfaults(FAR struct bq769x0_dev_s *priv,
uint8_t faults) uint8_t faults)
{ {
int ret; int ret;
@@ -1395,7 +1388,7 @@ static int bq769x0_online(struct battery_monitor_dev_s *dev, bool *status)
* *
****************************************************************************/ ****************************************************************************/
static inline int bq769x0_getvolt(FAR struct bq769x0_dev_s *priv, int *volts) static int bq769x0_getvolt(FAR struct bq769x0_dev_s *priv, int *volts)
{ {
uint16_t regval; uint16_t regval;
int ret; int ret;
@@ -1429,8 +1422,8 @@ static inline int bq769x0_getvolt(FAR struct bq769x0_dev_s *priv, int *volts)
* *
****************************************************************************/ ****************************************************************************/
static inline int bq769x0_getcellvolt(FAR struct bq769x0_dev_s *priv, static int bq769x0_getcellvolt(FAR struct bq769x0_dev_s *priv,
struct battery_monitor_voltage_s *voltages) FAR struct battery_monitor_voltage_s *voltages)
{ {
uint16_t regvals[BQ769X0_MAX_CELLS]; uint16_t regvals[BQ769X0_MAX_CELLS];
int ret; int ret;
@@ -1487,8 +1480,8 @@ static inline int bq769x0_getcellvolt(FAR struct bq769x0_dev_s *priv,
* *
****************************************************************************/ ****************************************************************************/
static inline int bq769x0_gettemperature(FAR struct bq769x0_dev_s *priv, static int bq769x0_gettemperature(FAR struct bq769x0_dev_s *priv,
struct battery_monitor_temperature_s *temps) FAR struct battery_monitor_temperature_s *temps)
{ {
int chip_sensors; int chip_sensors;
int ret; int ret;
@@ -1572,7 +1565,7 @@ static int bq769x0_chip_cellcount(FAR struct bq769x0_dev_s *priv)
* *
****************************************************************************/ ****************************************************************************/
static inline int bq769x0_getcurrent(FAR struct bq769x0_dev_s *priv, static int bq769x0_getcurrent(FAR struct bq769x0_dev_s *priv,
FAR struct battery_monitor_current_s *current) FAR struct battery_monitor_current_s *current)
{ {
/* The BQ769X0's "coulomb counter" reports average current over a 250ms /* The BQ769X0's "coulomb counter" reports average current over a 250ms
@@ -1663,8 +1656,8 @@ static inline int bq769x0_getcurrent(FAR struct bq769x0_dev_s *priv,
* *
****************************************************************************/ ****************************************************************************/
static inline int bq769x0_setbalance(FAR struct bq769x0_dev_s *priv, static int bq769x0_setbalance(FAR struct bq769x0_dev_s *priv,
struct battery_monitor_balance_s *bal) FAR struct battery_monitor_balance_s *bal)
{ {
int i; int i;
int j; int j;
@@ -1922,7 +1915,7 @@ static int bq769x0_shutdown(struct battery_monitor_dev_s *dev,
ret = bq769x0_doshutdown(priv); ret = bq769x0_doshutdown(priv);
if (ret < 0) if (ret < 0)
{ {
baterr("ERROR: Error putting BQ769X0 into low-power state! Error = %d\n", baterr("ERROR: putting BQ769X0 into low-power state! Error = %d\n",
ret); ret);
return ret; return ret;
} }
@@ -2100,7 +2093,7 @@ FAR struct battery_monitor_dev_s *
/* Initialize the BQ769x0 device structure */ /* Initialize the BQ769x0 device structure */
priv = (FAR struct bq769x0_dev_s *)kmm_zalloc(sizeof(struct bq769x0_dev_s)); priv = kmm_zalloc(sizeof(struct bq769x0_dev_s));
if (priv) if (priv)
{ {
/* Initialize the BQ769x0 device structure */ /* Initialize the BQ769x0 device structure */
+38 -39
View File
@@ -34,10 +34,10 @@
* *
****************************************************************************/ ****************************************************************************/
/* "The MAX17040/MAX17041 are ultra-compact, low-cost, host-side fuel-gauge /* "MAX17040/MAX17041 are ultra-compact, low-cost, host-side fuel-gauge
* systems for lithium-ion (Li+) batteries in handheld and portable equipment. * systems for lithium-ion (Li+) batteries in handheld and portable
* The MAX17040 is configured to operate with a single lithium cell and the * equipment. MAX17040 is configured to operate with a single lithium cell
* MAX17041 is configured for a dual-cell 2S pack. * and the MAX17041 is configured for a dual-cell 2S pack.
*/ */
/**************************************************************************** /****************************************************************************
@@ -83,14 +83,14 @@
/* MAX1704x Register Definitions ********************************************/ /* MAX1704x Register Definitions ********************************************/
/* "All host interaction with the MAX17040/MAX17041 is handled by writing to /* "All host interaction with MAX17040/MAX17041 is handled by writing to
* and reading from register locations. The MAX17040/MAX17041 have six 16-bit * and reading from register locations. MAX17040/MAX17041 have six 16-bit
* registers: SOC, VCELL, MODE, VERSION, RCOMP, and COMMAND. Register reads * registers: SOC, VCELL, MODE, VERSION, RCOMP, and COMMAND. Register reads
* and writes are only valid if all 16 bits are transferred..." * and writes are only valid if all 16 bits are transferred..."
*/ */
/* "VCELL Register. Battery voltage is measured at the CELL pin input with /* "VCELL Register. Battery voltage is measured at the CELL pin input with
* respect to GND over a 0 to 5.00V range for the MAX17040 and 0 to 10.00V * respect to GND over a 0 to 5.00V range for MAX17040 and 0 to 10.00V
* for the MAX17041 with resolutions of 1.25mV and 2.50mV, respectively..." * for the MAX17041 with resolutions of 1.25mV and 2.50mV, respectively..."
*/ */
@@ -111,8 +111,8 @@
#endif #endif
/* "SOC Register. The SOC register is a read-only register that displays the /* "SOC Register. The SOC register is a read-only register that displays the
* state of charge of the cell as calculated by the ModelGauge algorithm. The * state of charge of the cell as calculated by the ModelGauge algorithm.
* result is displayed as a percentage of the cells full capacity... * The result is displayed as a percentage of the cells full capacity...
* *
* "...Units of % can be directly determined by observing only the high byte * "...Units of % can be directly determined by observing only the high byte
* of the SOC register. The low byte provides additional resolution in units * of the SOC register. The low byte provides additional resolution in units
@@ -137,7 +137,7 @@
#define MAX1407X_MODE_QUICKSTART 0x4000 #define MAX1407X_MODE_QUICKSTART 0x4000
/* "The VERSION register is a read-only register that contains a value /* "The VERSION register is a read-only register that contains a value
* indicating the production version of the MAX17040/MAX17041." * indicating the production version of MAX17040/MAX17041."
*/ */
#define MAX1407X_VERSION_ADDR 0x08 /* Bits 0-15: 16-bit VERSION */ #define MAX1407X_VERSION_ADDR 0x08 /* Bits 0-15: 16-bit VERSION */
@@ -165,11 +165,7 @@
#ifdef CONFIG_DEBUG_MAX1704X #ifdef CONFIG_DEBUG_MAX1704X
# define baterr _err # define baterr _err
#else #else
# ifdef CONFIG_CPP_HAVE_VARARGS # define baterr _none
# define baterr(x...)
# else
# define baterr (void)
# endif
#endif #endif
/**************************************************************************** /****************************************************************************
@@ -196,10 +192,10 @@ struct max1704x_dev_s
/* I2C support */ /* I2C support */
static int max1704x_getreg16(FAR struct max1704x_dev_s *priv, uint8_t regaddr, static int max1704x_getreg16(FAR struct max1704x_dev_s *priv,
FAR uint16_t *regval); uint8_t regaddr, FAR uint16_t *regval);
static int max1704x_putreg16(FAR struct max1704x_dev_s *priv, uint8_t regaddr, static int max1704x_putreg16(FAR struct max1704x_dev_s *priv,
uint16_t regval); uint8_t regaddr, uint16_t regval);
static inline int max1704x_getvcell(FAR struct max1704x_dev_s *priv, static inline int max1704x_getvcell(FAR struct max1704x_dev_s *priv,
b16_t *vcell); b16_t *vcell);
@@ -244,8 +240,8 @@ static const struct battery_gauge_operations_s g_max1704xops =
* *
****************************************************************************/ ****************************************************************************/
static int max1704x_getreg16(FAR struct max1704x_dev_s *priv, uint8_t regaddr, static int max1704x_getreg16(FAR struct max1704x_dev_s *priv,
FAR uint16_t *regval) uint8_t regaddr, FAR uint16_t *regval)
{ {
struct i2c_config_s config; struct i2c_config_s config;
uint8_t buffer[2]; uint8_t buffer[2];
@@ -290,8 +286,8 @@ static int max1704x_getreg16(FAR struct max1704x_dev_s *priv, uint8_t regaddr,
* *
****************************************************************************/ ****************************************************************************/
static int max1704x_putreg16(FAR struct max1704x_dev_s *priv, uint8_t regaddr, static int max1704x_putreg16(FAR struct max1704x_dev_s *priv,
uint16_t regval) uint8_t regaddr, uint16_t regval)
{ {
struct i2c_config_s config; struct i2c_config_s config;
uint8_t buffer[3]; uint8_t buffer[3];
@@ -371,7 +367,8 @@ static inline int max1704x_getsoc(FAR struct max1704x_dev_s *priv,
static inline int max1704x_setquikstart(FAR struct max1704x_dev_s *priv) static inline int max1704x_setquikstart(FAR struct max1704x_dev_s *priv)
{ {
return max1704x_putreg16(priv, MAX1407X_MODE_ADDR, MAX1407X_MODE_QUICKSTART); return max1704x_putreg16(priv, MAX1407X_MODE_ADDR,
MAX1407X_MODE_QUICKSTART);
} }
/**************************************************************************** /****************************************************************************
@@ -396,7 +393,8 @@ static inline int max1704x_getversion(FAR struct max1704x_dev_s *priv,
* *
****************************************************************************/ ****************************************************************************/
static inline int max1704x_setrcomp(FAR struct max1704x_dev_s *priv, uint16_t rcomp) static inline int max1704x_setrcomp(FAR struct max1704x_dev_s *priv,
uint16_t rcomp)
{ {
return max1704x_putreg16(priv, MAX1407X_RCOMP_ADDR, rcomp); return max1704x_putreg16(priv, MAX1407X_RCOMP_ADDR, rcomp);
} }
@@ -405,13 +403,14 @@ static inline int max1704x_setrcomp(FAR struct max1704x_dev_s *priv, uint16_t rc
* Name: max1704x_reset * Name: max1704x_reset
* *
* Description: * Description:
* Reset the MAX1704x * Reset MAX1704x
* *
****************************************************************************/ ****************************************************************************/
static inline int max1704x_reset(FAR struct max1704x_dev_s *priv) static inline int max1704x_reset(FAR struct max1704x_dev_s *priv)
{ {
return max1704x_putreg16(priv, MAX1407X_COMMAND_ADDR, MAX1407X_COMMAND_POR); return max1704x_putreg16(priv, MAX1407X_COMMAND_ADDR,
MAX1407X_COMMAND_POR);
} }
/**************************************************************************** /****************************************************************************
@@ -510,7 +509,7 @@ static int max1704x_capacity(struct battery_gauge_dev_s *dev, b16_t *value)
* Name: max1704x_initialize * Name: max1704x_initialize
* *
* Description: * Description:
* Initialize the MAX1704x battery driver and return an instance of the * Initialize MAX1704x battery driver and return an instance of the
* lower_half interface that may be used with battery_register(); * lower_half interface that may be used with battery_register();
* *
* This driver requires: * This driver requires:
@@ -522,31 +521,31 @@ static int max1704x_capacity(struct battery_gauge_dev_s *dev, b16_t *value)
* chip is on the board in order to scale the voltage correctly. * chip is on the board in order to scale the voltage correctly.
* *
* Input Parameters: * Input Parameters:
* i2c - An instance of the I2C interface to use to communicate with the MAX1704x * i2c - An instance of the I2C interface to communicate with MAX1704x
* addr - The I2C address of the MAX1704x (Better be 0x36). * addr - The I2C address of MAX1704x (Better be 0x36).
* frequency - The I2C frequency * frequency - The I2C frequency
* *
* Returned Value: * Returned Value:
* A pointer to the initializeed lower-half driver instance. A NULL pointer * A pointer to the initializeed lower-half driver instance. A NULL pointer
* is returned on a failure to initialize the MAX1704x lower half. * is returned on a failure to initialize MAX1704x lower half.
* *
****************************************************************************/ ****************************************************************************/
FAR struct battery_gauge_dev_s *max1704x_initialize(FAR struct i2c_master_s *i2c, FAR struct battery_gauge_dev_s *
uint8_t addr, max1704x_initialize(FAR struct i2c_master_s *i2c,
uint32_t frequency) uint8_t addr, uint32_t frequency)
{ {
FAR struct max1704x_dev_s *priv; FAR struct max1704x_dev_s *priv;
#if 0 #if 0
int ret; int ret;
#endif #endif
/* Initialize the MAX1704x device structure */ /* Initialize MAX1704x device structure */
priv = (FAR struct max1704x_dev_s *)kmm_zalloc(sizeof(struct max1704x_dev_s)); priv = kmm_zalloc(sizeof(struct max1704x_dev_s));
if (priv) if (priv)
{ {
/* Initialize the MAX1704x device structure */ /* Initialize MAX1704x device structure */
nxsem_init(&priv->batsem, 0, 1); nxsem_init(&priv->batsem, 0, 1);
priv->ops = &g_max1704xops; priv->ops = &g_max1704xops;
@@ -554,13 +553,13 @@ FAR struct battery_gauge_dev_s *max1704x_initialize(FAR struct i2c_master_s *i2c
priv->addr = addr; priv->addr = addr;
priv->frequency = frequency; priv->frequency = frequency;
/* Reset the MAX1704x (mostly just to make sure that we can talk to it) */ /* Reset MAX1704x (mostly just to make sure that we can talk to it) */
#if 0 #if 0
ret = max1704x_reset(priv); ret = max1704x_reset(priv);
if (ret < 0) if (ret < 0)
{ {
baterr("Failed to reset the MAX1704x: %d\n", ret); baterr("Failed to reset MAX1704x: %d\n", ret);
kmm_free(priv); kmm_free(priv);
return NULL; return NULL;
} }
+2 -7
View File
@@ -78,13 +78,8 @@
# define baterr _err # define baterr _err
# define batreg _err # define batreg _err
#else #else
# ifdef CONFIG_CPP_HAVE_VARARGS # define baterr _none
# define baterr(x...) # define batreg _none
# define batreg(x...)
# else
# define baterr (void)
# define batreg (void)
# endif
#endif #endif
/**************************************************************************** /****************************************************************************
+2 -18
View File
@@ -68,32 +68,16 @@
#undef cserr #undef cserr
#ifdef CONFIG_CS2100CP_DEBUG #ifdef CONFIG_CS2100CP_DEBUG
# ifdef CONFIG_CPP_HAVE_VARARGS
# define cserr(format, ...) _err(format, ##__VA_ARGS__)
# else
# define cserr _err # define cserr _err
# endif
#else #else
# ifdef CONFIG_CPP_HAVE_VARARGS # define cserr _none
# define cserr(x...)
# else
# define cserr (void)
# endif
#endif #endif
#undef reginfo #undef reginfo
#ifdef CONFIG_CS2100CP_REGDEBUG #ifdef CONFIG_CS2100CP_REGDEBUG
# ifdef CONFIG_CPP_HAVE_VARARGS
# define reginfo(format, ...) _err(format, ##__VA_ARGS__)
# else
# define reginfo _err # define reginfo _err
# endif
#else #else
# ifdef CONFIG_CPP_HAVE_VARARGS # define reginfo _none
# define reginfo(x...)
# else
# define reginfo (void)
# endif
#endif #endif
/**************************************************************************** /****************************************************************************
+2 -10
View File
@@ -1,5 +1,5 @@
/**************************************************************************** /****************************************************************************
* fs/spiffs.h/spiffs_cache.h * fs/spiffs/src/spiffs_cache.h
* *
* Copyright (C) 2018 Gregory Nutt. All rights reserved. * Copyright (C) 2018 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org> * Author: Gregory Nutt <gnutt@nuttx.org>
@@ -77,17 +77,9 @@ extern "C"
/* Debug */ /* Debug */
#ifdef CONFIG_SPIFFS_CACHEDBG #ifdef CONFIG_SPIFFS_CACHEDBG
# ifdef CONFIG_CPP_HAVE_VARARGS
# define spiffs_cacheinfo(format, ...) _info(format, ##__VA_ARGS__)
# else
# define spiffs_cacheinfo _info # define spiffs_cacheinfo _info
# endif
#else #else
# ifdef CONFIG_CPP_HAVE_VARARGS # define spiffs_cacheinfo _none
# define spiffs_cacheinfo(format, ...)
# else
# define spiffs_cacheinfo (void)
# endif
#endif #endif
/**************************************************************************** /****************************************************************************
+6 -12
View File
@@ -1,5 +1,5 @@
/**************************************************************************** /****************************************************************************
* fs/spiffs.h/spiffs_check.h * fs/spiffs/src/spiffs_check.h
* *
* Copyright (C) 2018 Gregory Nutt. All rights reserved. * Copyright (C) 2018 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org> * Author: Gregory Nutt <gnutt@nuttx.org>
@@ -55,20 +55,14 @@ extern "C"
/* Consistency check output */ /* Consistency check output */
#ifdef CONFIG_SPIFFS_CHECK_OUTPUT #if !defined(CONFIG_SPIFFS_CHECK_OUTPUT)
# ifdef CONFIG_CPP_HAVE_VARARGS # define spiffs_checkinfo _none
#elif defined(CONFIG_CPP_HAVE_VARARGS)
# define spiffs_checkinfo(format, ...) \ # define spiffs_checkinfo(format, ...) \
syslog(LOG_NOTICE, "SPIFFS: " format, ##__VA_ARGS__) syslog(LOG_NOTICE, "SPIFFS: " format, ##__VA_ARGS__)
#else #else
# define spiffs_checkinfo _info # define spiffs_checkinfo _info
#endif #endif
#else
# ifdef CONFIG_CPP_HAVE_VARARGS
# define spiffs_checkinfo(format, ...)
# else
# define spiffs_checkinfo (void)
# endif
#endif
/**************************************************************************** /****************************************************************************
* Public Function Prototypes * Public Function Prototypes
@@ -114,7 +108,8 @@ int spiffs_check_luconsistency(FAR struct spiffs_s *fs);
* - x011 used, referenced only once, not index * - x011 used, referenced only once, not index
* - x101 used, unreferenced, index * - x101 used, unreferenced, index
* *
* The working memory might not fit all pages so several scans might be needed * The working memory might not fit all pages so several scans might be
* needed
* *
* Input Parameters: * Input Parameters:
* fs - A reference to the SPIFFS volume object instance * fs - A reference to the SPIFFS volume object instance
@@ -147,7 +142,6 @@ int spiffs_check_pgconsistency(FAR struct spiffs_s *fs);
int spiffs_check_objidconsistency(FAR struct spiffs_s *fs); int spiffs_check_objidconsistency(FAR struct spiffs_s *fs);
/**************************************************************************** /****************************************************************************
* Name: spiffs_dump * Name: spiffs_dump
* *
+4 -12
View File
@@ -1,5 +1,5 @@
/**************************************************************************** /****************************************************************************
* fs/spiffs.h/spiffs_gc.h * fs/spiffs/src/spiffs_gc.h
* *
* Copyright (C) 2018 Gregory Nutt. All rights reserved. * Copyright (C) 2018 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org> * Author: Gregory Nutt <gnutt@nuttx.org>
@@ -56,17 +56,9 @@ extern "C"
/* Debug */ /* Debug */
#ifdef CONFIG_SPIFFS_GCDBG #ifdef CONFIG_SPIFFS_GCDBG
# ifdef CONFIG_CPP_HAVE_VARARGS
# define spiffs_gcinfo(format, ...) _info(format, ##__VA_ARGS__)
# else
# define spiffs_gcinfo _info # define spiffs_gcinfo _info
# endif
#else #else
# ifdef CONFIG_CPP_HAVE_VARARGS # define spiffs_gcinfo _none
# define spiffs_gcinfo(format, ...)
# else
# define spiffs_gcinfo (void)
# endif
#endif #endif
/**************************************************************************** /****************************************************************************
@@ -111,8 +103,8 @@ int spiffs_gc_quick(FAR struct spiffs_s *fs, uint16_t max_free_pages);
* this method in order to determine what amount of bytes to give. * this method in order to determine what amount of bytes to give.
* *
* NB: the garbage collector is automatically called when spiffs needs free * NB: the garbage collector is automatically called when spiffs needs free
* pages. The reason for this function is to give possibility to do background * pages. The reason for this function is to give possibility to do
* tidying when user knows the system is idle. * background tidying when user knows the system is idle.
* *
* Input Parameters: * Input Parameters:
* fs the file system struct * fs the file system struct
+2 -10
View File
@@ -1,5 +1,5 @@
/**************************************************************************** /****************************************************************************
* fs/spiffs.h/spiffs_mtd.h * fs/spiffs/src/spiffs_mtd.h
* *
* Copyright (C) 2018 Gregory Nutt. All rights reserved. * Copyright (C) 2018 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org> * Author: Gregory Nutt <gnutt@nuttx.org>
@@ -69,17 +69,9 @@ extern "C"
/* Debug */ /* Debug */
#ifdef CONFIG_SPIFFS_MTDDBG #ifdef CONFIG_SPIFFS_MTDDBG
# ifdef CONFIG_CPP_HAVE_VARARGS
# define spiffs_mtdinfo(format, ...) _info(format, ##__VA_ARGS__)
# else
# define spiffs_mtdinfo _info # define spiffs_mtdinfo _info
# endif
#else #else
# ifdef CONFIG_CPP_HAVE_VARARGS # define spiffs_mtdinfo _none
# define spiffs_mtdinfo(format, ...)
# else
# define spiffs_mtdinfo (void)
# endif
#endif #endif
/* Commonly used Macros */ /* Commonly used Macros */
+5 -16
View File
@@ -181,25 +181,13 @@
/* Debug */ /* Debug */
#ifdef CONFIG_VNCSERVER_UPDATE_DEBUG #ifdef CONFIG_VNCSERVER_UPDATE_DEBUG
# ifdef CONFIG_CPP_HAVE_VARARGS
# define upderr(format, ...) _err(format, ##__VA_ARGS__)
# define updinfo(format, ...) _info(format, ##__VA_ARGS__)
# define updinfo(format, ...) _info(format, ##__VA_ARGS__)
# else
# define upderr _err # define upderr _err
# define updwarn _warn # define updwarn _warn
# define updinfo _info # define updinfo _info
# endif
#else #else
# ifdef CONFIG_CPP_HAVE_VARARGS # define upderr _none
# define upderr(x...) # define updwarn _none
# define updwarn(x...) # define updinfo _none
# define updinfo(x...)
# else
# define upderr (void)
# define updwarn (void)
# define updinfo (void)
# endif
#endif #endif
/**************************************************************************** /****************************************************************************
@@ -583,7 +571,8 @@ uint32_t vnc_convert_rgb32_888(lfb_color_t rgb);
* *
****************************************************************************/ ****************************************************************************/
int vnc_colors(FAR struct vnc_session_s *session, FAR struct nxgl_rect_s *rect, int vnc_colors(FAR struct vnc_session_s *session,
FAR struct nxgl_rect_s *rect,
unsigned int maxcolors, FAR lfb_color_t *colors); unsigned int maxcolors, FAR lfb_color_t *colors);
#undef EXTERN #undef EXTERN
+121 -727
View File
File diff suppressed because it is too large Load Diff
-8
View File
@@ -72,11 +72,7 @@
*/ */
#if !defined(CONFIG_BUILD_FLAT) && defined(__KERNEL__) #if !defined(CONFIG_BUILD_FLAT) && defined(__KERNEL__)
# ifdef CONFIG_CPP_HAVE_VARARGS
# define _NX_OPEN(p,f,...) nx_open(p,f,##__VA_ARGS__)
# else
# define _NX_OPEN nx_open # define _NX_OPEN nx_open
# endif
# define _NX_CLOSE(f) nx_close(f) # define _NX_CLOSE(f) nx_close(f)
# define _NX_READ(f,b,s) nx_read(f,b,s) # define _NX_READ(f,b,s) nx_read(f,b,s)
# define _NX_WRITE(f,b,s) nx_write(f,b,s) # define _NX_WRITE(f,b,s) nx_write(f,b,s)
@@ -87,11 +83,7 @@
# define _NX_SETERRNO(r) set_errno(-(r)) # define _NX_SETERRNO(r) set_errno(-(r))
# define _NX_GETERRVAL(r) (r) # define _NX_GETERRVAL(r) (r)
#else #else
# ifdef CONFIG_CPP_HAVE_VARARGS
# define _NX_OPEN(p,f,...) open(p,f,##__VA_ARGS__)
# else
# define _NX_OPEN open # define _NX_OPEN open
# endif
# define _NX_CLOSE(f) close(f) # define _NX_CLOSE(f) close(f)
# define _NX_READ(f,b,s) read(f,b,s) # define _NX_READ(f,b,s) read(f,b,s)
# define _NX_WRITE(f,b,s) write(f,b,s) # define _NX_WRITE(f,b,s) write(f,b,s)
+3 -12
View File
@@ -51,6 +51,7 @@
/**************************************************************************** /****************************************************************************
* Pre-processor Definitions * Pre-processor Definitions
****************************************************************************/ ****************************************************************************/
/* Configuration ************************************************************/ /* Configuration ************************************************************/
#ifndef CONFIG_ARCH_ADDRENV #ifndef CONFIG_ARCH_ADDRENV
@@ -71,22 +72,12 @@
/* Debug */ /* Debug */
#ifdef CONFIG_CPP_HAVE_VARARGS
# ifdef CONFIG_DEBUG_SHM
# define shmerr(format, ...) _err(format, ##__VA_ARGS__)
# define shminfo(format, ...) _info(format, ##__VA_ARGS__)
# else
# define shmerr(format, ...) merr(format, ##__VA_ARGS__)
# define shminfo(format, ...) minfo(format, ##__VA_ARGS__)
# endif
#else
#ifdef CONFIG_DEBUG_SHM #ifdef CONFIG_DEBUG_SHM
# define shmerr _err # define shmerr _err
# define shminfo _info # define shminfo _info
#else #else
# define shmerr (void) # define shmerr merr
# define shminfo (void) # define shminfo minfo
# endif
#endif #endif
/**************************************************************************** /****************************************************************************
+35 -34
View File
@@ -51,7 +51,7 @@
#define BQ2429X_CURRCHG_MIN 512 #define BQ2429X_CURRCHG_MIN 512
#define BQ2429X_CURRCHG_MAX 3008 #define BQ2429X_CURRCHG_MAX 3008
/* BQ2429X Register Definitions ********************************************/ /* BQ2429X Register Definitions *********************************************/
#define BQ2429X_REG00 0x00 #define BQ2429X_REG00 0x00
#define BQ2429X_REG01 0x01 #define BQ2429X_REG01 0x01
#define BQ2429X_REG02 0x02 #define BQ2429X_REG02 0x02
@@ -70,8 +70,9 @@
#define BQ2429XR1_EN_HIZ (1 << 7) /* 0 Disable (default) 1 Enable HighZ on battery, powerdown */ #define BQ2429XR1_EN_HIZ (1 << 7) /* 0 Disable (default) 1 Enable HighZ on battery, powerdown */
/* Dynamic Power Management - Indicated in StatusReg DPM_STAT REG08[3] /* Dynamic Power Management - Indicated in StatusReg DPM_STAT REG08[3]
VINDPM - Input Voltage threshold (a drop below 5V) that triggers DPM * VINDPM - Input Voltage threshold (a drop below 5V) that triggers DPM
INLIM - Input current threshold that triggers DPM */ * INLIM - Input current threshold that triggers DPM
*/
#define BQ2429XR0_VINDPM_SHIFT 3 /* VIN DPM Offset 5V? Range*/ #define BQ2429XR0_VINDPM_SHIFT 3 /* VIN DPM Offset 5V? Range*/
#define BQ2429XR0_VINDPM_MASK (0xf << BQ2429XR0_VINDPM_SHIFT) #define BQ2429XR0_VINDPM_MASK (0xf << BQ2429XR0_VINDPM_SHIFT)
@@ -81,14 +82,14 @@
# define BQ2429XR0_VINDPM0_640mV (8 << BQ2429XR0_VINDPM_SHIFT) # define BQ2429XR0_VINDPM0_640mV (8 << BQ2429XR0_VINDPM_SHIFT)
#define BQ2429XR0_INLIM_SHIFT 0 /* Input Current Limit - lower of I2C & ILIM */ #define BQ2429XR0_INLIM_SHIFT 0 /* Input Current Limit - lower of I2C & ILIM */
#define BQ2429XR0_INLIM_MASK (0x7 << BQ2429XR0_INLIM_SHIFT) #define BQ2429XR0_INLIM_MASK (0x7 << BQ2429XR0_INLIM_SHIFT)
# define BQ2429XR0_INLIM_0100mA (0x0 << BQ2429XR0_INLIM_SHIFT) # define BQ2429XR0_INLIM_0100MA (0x0 << BQ2429XR0_INLIM_SHIFT)
# define BQ2429XR0_INLIM_0150mA (0x1 << BQ2429XR0_INLIM_SHIFT) # define BQ2429XR0_INLIM_0150MA (0x1 << BQ2429XR0_INLIM_SHIFT)
# define BQ2429XR0_INLIM_0500mA (0x2 << BQ2429XR0_INLIM_SHIFT) # define BQ2429XR0_INLIM_0500MA (0x2 << BQ2429XR0_INLIM_SHIFT)
# define BQ2429XR0_INLIM_0900mA (0x3 << BQ2429XR0_INLIM_SHIFT) # define BQ2429XR0_INLIM_0900MA (0x3 << BQ2429XR0_INLIM_SHIFT)
# define BQ2429XR0_INLIM_1000mA (0x4 << BQ2429XR0_INLIM_SHIFT) # define BQ2429XR0_INLIM_1000MA (0x4 << BQ2429XR0_INLIM_SHIFT)
# define BQ2429XR0_INLIM_1500mA (0x5 << BQ2429XR0_INLIM_SHIFT) # define BQ2429XR0_INLIM_1500MA (0x5 << BQ2429XR0_INLIM_SHIFT)
# define BQ2429XR0_INLIM_2000mA (0x6 << BQ2429XR0_INLIM_SHIFT) # define BQ2429XR0_INLIM_2000MA (0x6 << BQ2429XR0_INLIM_SHIFT)
# define BQ2429XR0_INLIM_3000mA (0x7 << BQ2429XR0_INLIM_SHIFT) # define BQ2429XR0_INLIM_3000MA (0x7 << BQ2429XR0_INLIM_SHIFT)
/* REG01 Power-On Configuration Register */ /* REG01 Power-On Configuration Register */
@@ -116,29 +117,29 @@
#define BQ2429XR3_IPRECHG_SHIFT 4 /* Precharge I Limit. Offset 128mA Range 128-2048 mA */ #define BQ2429XR3_IPRECHG_SHIFT 4 /* Precharge I Limit. Offset 128mA Range 128-2048 mA */
#define BQ2429XR3_IPRECHG_MASK (0xf << BQ2429XR3_IPRECHG_SHIFT) #define BQ2429XR3_IPRECHG_MASK (0xf << BQ2429XR3_IPRECHG_SHIFT)
#define BQ2429XR3_IPRECHG_0128mA (0x00 << BQ2429XR3_IPRECHG_SHIFT) #define BQ2429XR3_IPRECHG_0128MA (0x00 << BQ2429XR3_IPRECHG_SHIFT)
#define BQ2429XR3_IPRECHG_0128mA (0x01 << BQ2429XR3_IPRECHG_SHIFT) #define BQ2429XR3_IPRECHG_0128MA (0x01 << BQ2429XR3_IPRECHG_SHIFT)
#define BQ2429XR3_IPRECHG_0256mA (0x02 << BQ2429XR3_IPRECHG_SHIFT) #define BQ2429XR3_IPRECHG_0256MA (0x02 << BQ2429XR3_IPRECHG_SHIFT)
#define BQ2429XR3_IPRECHG_0384mA (0x03 << BQ2429XR3_IPRECHG_SHIFT) #define BQ2429XR3_IPRECHG_0384MA (0x03 << BQ2429XR3_IPRECHG_SHIFT)
#define BQ2429XR3_IPRECHG_0512mA (0x04 << BQ2429XR3_IPRECHG_SHIFT) #define BQ2429XR3_IPRECHG_0512MA (0x04 << BQ2429XR3_IPRECHG_SHIFT)
#define BQ2429XR3_IPRECHG_0768mA (0x05 << BQ2429XR3_IPRECHG_SHIFT) #define BQ2429XR3_IPRECHG_0768MA (0x05 << BQ2429XR3_IPRECHG_SHIFT)
#define BQ2429XR3_IPRECHG_0896mA (0x06 << BQ2429XR3_IPRECHG_SHIFT) #define BQ2429XR3_IPRECHG_0896MA (0x06 << BQ2429XR3_IPRECHG_SHIFT)
#define BQ2429XR3_IPRECHG_1024mA (0x07 << BQ2429XR3_IPRECHG_SHIFT) #define BQ2429XR3_IPRECHG_1024MA (0x07 << BQ2429XR3_IPRECHG_SHIFT)
#define BQ2429XR3_IPRECHG_1152mA (0x10 << BQ2429XR3_IPRECHG_SHIFT) #define BQ2429XR3_IPRECHG_1152MA (0x10 << BQ2429XR3_IPRECHG_SHIFT)
#define BQ2429XR3_IPRECHG_1280mA (0x11 << BQ2429XR3_IPRECHG_SHIFT) #define BQ2429XR3_IPRECHG_1280MA (0x11 << BQ2429XR3_IPRECHG_SHIFT)
#define BQ2429XR3_IPRECHG_1408mA (0x12 << BQ2429XR3_IPRECHG_SHIFT) #define BQ2429XR3_IPRECHG_1408MA (0x12 << BQ2429XR3_IPRECHG_SHIFT)
#define BQ2429XR3_IPRECHG_1536mA (0x13 << BQ2429XR3_IPRECHG_SHIFT) #define BQ2429XR3_IPRECHG_1536MA (0x13 << BQ2429XR3_IPRECHG_SHIFT)
#define BQ2429XR3_IPRECHG_1664mA (0x14 << BQ2429XR3_IPRECHG_SHIFT) #define BQ2429XR3_IPRECHG_1664MA (0x14 << BQ2429XR3_IPRECHG_SHIFT)
#define BQ2429XR3_IPRECHG_1792mA (0x15 << BQ2429XR3_IPRECHG_SHIFT) #define BQ2429XR3_IPRECHG_1792MA (0x15 << BQ2429XR3_IPRECHG_SHIFT)
#define BQ2429XR3_IPRECHG_1920mA (0x16 << BQ2429XR3_IPRECHG_SHIFT) #define BQ2429XR3_IPRECHG_1920MA (0x16 << BQ2429XR3_IPRECHG_SHIFT)
#define BQ2429XR3_IPRECHG_2048mA (0x17 << BQ2429XR3_IPRECHG_SHIFT) #define BQ2429XR3_IPRECHG_2048MA (0x17 << BQ2429XR3_IPRECHG_SHIFT)
#define BQ2429XR3_ITERM_SHIFT 0 /* Offset 128mA Range 128-2048 mA (128-1024 mA in BQ24296M )*/ #define BQ2429XR3_ITERM_SHIFT 0 /* Offset 128mA Range 128-2048 mA (128-1024 mA in BQ24296M )*/
#define BQ2429XR3_ITERM_MASK (0xf << BQ2429XR3_ITERM_SHIFT) #define BQ2429XR3_ITERM_MASK (0xf << BQ2429XR3_ITERM_SHIFT)
#define BQ2429XR3_ITERM0_128mA (1 << BQ2429XR3_ITERM_SHIFT) #define BQ2429XR3_ITERM0_128MA (1 << BQ2429XR3_ITERM_SHIFT)
#define BQ2429XR3_ITERM0_256mA (2 << BQ2429XR3_ITERM_SHIFT) #define BQ2429XR3_ITERM0_256MA (2 << BQ2429XR3_ITERM_SHIFT)
#define BQ2429XR3_ITERM0_512mA (4 << BQ2429XR3_ITERM_SHIFT) #define BQ2429XR3_ITERM0_512MA (4 << BQ2429XR3_ITERM_SHIFT)
#define BQ2429XR3_ITERM0_1024mA (8 << BQ2429XR3_ITERM_SHIFT) /* Reserved in BQ24296M */ #define BQ2429XR3_ITERM0_1024MA (8 << BQ2429XR3_ITERM_SHIFT) /* Reserved in BQ24296M */
/* REG04 Charge Voltage Control Register */ /* REG04 Charge Voltage Control Register */
#define BQ2429XR4_VREG_SHIFT 2 /* Offset 3.504V Range 3.504-4.400V Default 4.208V */ #define BQ2429XR4_VREG_SHIFT 2 /* Offset 3.504V Range 3.504-4.400V Default 4.208V */
@@ -154,9 +155,9 @@
#define BQ2429XR5_WATCHDOG_SHIFT 4 /* Watchdog Timer Settings */ #define BQ2429XR5_WATCHDOG_SHIFT 4 /* Watchdog Timer Settings */
#define BQ2429XR5_WATCHDOG_MASK (3 << BQ2429XR5_WATCHDOG_SHIFT) #define BQ2429XR5_WATCHDOG_MASK (3 << BQ2429XR5_WATCHDOG_SHIFT)
# define BQ2429XR5_WATCHDOG_DIS (0 << BQ2429XR5_WATCHDOG_SHIFT) # define BQ2429XR5_WATCHDOG_DIS (0 << BQ2429XR5_WATCHDOG_SHIFT)
# define BQ2429XR5_WATCHDOG_040Sec (1 << BQ2429XR5_WATCHDOG_SHIFT) # define BQ2429XR5_WATCHDOG_040SEC (1 << BQ2429XR5_WATCHDOG_SHIFT)
# define BQ2429XR5_WATCHDOG_080Sec (2 << BQ2429XR5_WATCHDOG_SHIFT) # define BQ2429XR5_WATCHDOG_080SEC (2 << BQ2429XR5_WATCHDOG_SHIFT)
# define BQ2429XR5_WATCHDOG_160Sec (3 << BQ2429XR5_WATCHDOG_SHIFT) # define BQ2429XR5_WATCHDOG_160SEC (3 << BQ2429XR5_WATCHDOG_SHIFT)
#define BQ2429XR5_EN_TIMER (1 << 3) /* 0=Disable 1=Enable(default) */ #define BQ2429XR5_EN_TIMER (1 << 3) /* 0=Disable 1=Enable(default) */
/* Fast Charge Timer Settings */ /* Fast Charge Timer Settings */
+4 -3
View File
@@ -1,4 +1,8 @@
"__errno","errno.h","defined(CONFIG_BUILD_FLAT)","FAR int *" "__errno","errno.h","defined(CONFIG_BUILD_FLAT)","FAR int *"
"_alert","debug.h","!defined(CONFIG_CPP_HAVE_VARARGS) && defined(CONFIG_DEBUG_ERROR)","int","FAR const char *","..."
"_err","debug.h","!defined(CONFIG_CPP_HAVE_VARARGS) && defined(CONFIG_DEBUG_ERROR)","int","FAR const char *","..."
"_info","debug.h","!defined(CONFIG_CPP_HAVE_VARARGS) && defined(CONFIG_DEBUG_INFO)","int","FAR const char *","..."
"_warn","debug.h","!defined(CONFIG_CPP_HAVE_VARARGS) && defined(CONFIG_DEBUG_WARN)","int","FAR const char *","..."
"abort","stdlib.h","","void" "abort","stdlib.h","","void"
"abs","stdlib.h","","int","int" "abs","stdlib.h","","int","int"
"aio_error","aio.h","defined(CONFIG_FS_AIO)","int","FAR struct aiocb *" "aio_error","aio.h","defined(CONFIG_FS_AIO)","int","FAR struct aiocb *"
@@ -28,7 +32,6 @@
"dq_rem","queue.h","","void","FAR dq_entry_t *","dq_queue_t *" "dq_rem","queue.h","","void","FAR dq_entry_t *","dq_queue_t *"
"dq_remfirst","queue.h","","FAR dq_entry_t","dq_queue_t *" "dq_remfirst","queue.h","","FAR dq_entry_t","dq_queue_t *"
"dq_remlast","queue.h","","FAR dq_entry_t","dq_queue_t *" "dq_remlast","queue.h","","FAR dq_entry_t","dq_queue_t *"
"_err","debug.h","!defined(CONFIG_CPP_HAVE_VARARGS) && defined(CONFIG_DEBUG_ERROR)","int","FAR const char *","..."
"ether_ntoa","netinet/ether.h","","FAR char","FAR const struct ether_addr *" "ether_ntoa","netinet/ether.h","","FAR char","FAR const struct ether_addr *"
"fclose","stdio.h","CONFIG_NFILE_STREAMS > 0","int","FAR FILE *" "fclose","stdio.h","CONFIG_NFILE_STREAMS > 0","int","FAR FILE *"
"fdopen","stdio.h","CONFIG_NFILE_STREAMS > 0","FAR FILE","int","FAR const char *" "fdopen","stdio.h","CONFIG_NFILE_STREAMS > 0","FAR FILE","int","FAR const char *"
@@ -204,7 +207,6 @@
"ub16sqr","fixedmath.h","!defined(CONFIG_HAVE_LONG_LONG)","ub16_t","ub16_t" "ub16sqr","fixedmath.h","!defined(CONFIG_HAVE_LONG_LONG)","ub16_t","ub16_t"
"ungetc","stdio.h","CONFIG_NFILE_STREAMS > 0","int","int","FAR FILE *" "ungetc","stdio.h","CONFIG_NFILE_STREAMS > 0","int","int","FAR FILE *"
"usleep","unistd.h","","int","int","FAR FILE *" "usleep","unistd.h","","int","int","FAR FILE *"
"_info","debug.h","!defined(CONFIG_CPP_HAVE_VARARGS) && defined(CONFIG_DEBUG_INFO)","int","FAR const char *","..."
"vfprintf","stdio.h","CONFIG_NFILE_STREAMS > 0","int","FAR FILE *","FAR const char *","va_list" "vfprintf","stdio.h","CONFIG_NFILE_STREAMS > 0","int","FAR FILE *","FAR const char *","va_list"
"vprintf","stdio.h","CONFIG_NFILE_STREAMS > 0","int","FAR const char *","va_list" "vprintf","stdio.h","CONFIG_NFILE_STREAMS > 0","int","FAR const char *","va_list"
"vsnprintf","stdio.h","","int","FAR char *","size_t","FAR const char *","va_list" "vsnprintf","stdio.h","","int","FAR char *","size_t","FAR const char *","va_list"
@@ -234,4 +236,3 @@
"wmemmove","wchar.h","defined(CONFIG_LIBC_WCHAR)","wchat_t *","wchar_t *","wchar_t *","size_t" "wmemmove","wchar.h","defined(CONFIG_LIBC_WCHAR)","wchat_t *","wchar_t *","wchar_t *","size_t"
"wmemset","wchar.h","defined(CONFIG_LIBC_WCHAR)","wchat_t *","wchar_t *","wchar_t","size_t" "wmemset","wchar.h","defined(CONFIG_LIBC_WCHAR)","wchat_t *","wchar_t *","wchar_t","size_t"
"writev","sys/uio.h","","ssize_t","int","FAR const struct iovec *","int" "writev","sys/uio.h","","ssize_t","int","FAR const struct iovec *","int"
"_warn","debug.h","!defined(CONFIG_CPP_HAVE_VARARGS) && defined(CONFIG_DEBUG_WARN)","int","FAR const char *","..."
1 __errno errno.h defined(CONFIG_BUILD_FLAT) FAR int *
2 _alert debug.h !defined(CONFIG_CPP_HAVE_VARARGS) && defined(CONFIG_DEBUG_ERROR) int
3 _err debug.h !defined(CONFIG_CPP_HAVE_VARARGS) && defined(CONFIG_DEBUG_ERROR) int
4 _info debug.h !defined(CONFIG_CPP_HAVE_VARARGS) && defined(CONFIG_DEBUG_INFO) int
5 _warn debug.h !defined(CONFIG_CPP_HAVE_VARARGS) && defined(CONFIG_DEBUG_WARN) int
6 abort stdlib.h void
7 abs stdlib.h int
8 aio_error aio.h defined(CONFIG_FS_AIO) int
32 dq_rem queue.h void
33 dq_remfirst queue.h FAR dq_entry_t
34 dq_remlast queue.h FAR dq_entry_t
_err debug.h !defined(CONFIG_CPP_HAVE_VARARGS) && defined(CONFIG_DEBUG_ERROR) int
35 ether_ntoa netinet/ether.h FAR char
36 fclose stdio.h CONFIG_NFILE_STREAMS > 0 int
37 fdopen stdio.h CONFIG_NFILE_STREAMS > 0 FAR FILE
207 ub16sqr fixedmath.h !defined(CONFIG_HAVE_LONG_LONG) ub16_t
208 ungetc stdio.h CONFIG_NFILE_STREAMS > 0 int
209 usleep unistd.h int
_info debug.h !defined(CONFIG_CPP_HAVE_VARARGS) && defined(CONFIG_DEBUG_INFO) int
210 vfprintf stdio.h CONFIG_NFILE_STREAMS > 0 int
211 vprintf stdio.h CONFIG_NFILE_STREAMS > 0 int
212 vsnprintf stdio.h int
236 wmemmove wchar.h defined(CONFIG_LIBC_WCHAR) wchat_t *
237 wmemset wchar.h defined(CONFIG_LIBC_WCHAR) wchat_t *
238 writev sys/uio.h ssize_t
_warn debug.h !defined(CONFIG_CPP_HAVE_VARARGS) && defined(CONFIG_DEBUG_WARN) int
+3 -23
View File
@@ -54,33 +54,13 @@
****************************************************************************/ ****************************************************************************/
#if defined(CONFIG_DEBUG_FEATURES) && defined(CONFIG_IOB_DEBUG) #if defined(CONFIG_DEBUG_FEATURES) && defined(CONFIG_IOB_DEBUG)
#ifdef CONFIG_CPP_HAVE_VARARGS
# define ioberr(format, ...) _err(format, ##__VA_ARGS__)
# define iobwarn(format, ...) _warn(format, ##__VA_ARGS__)
# define iobinfo(format, ...) _info(format, ##__VA_ARGS__)
#else
# define ioberr _err # define ioberr _err
# define iobwarn _warn # define iobwarn _warn
# define iobinfo _info # define iobinfo _info
#endif
#else #else
#ifdef CONFIG_CPP_HAVE_VARARGS # define ioberr _none
# define iobwarn _none
# define ioberr(format, ...) # define iobinfo _none
# define iobwarn(format, ...)
# define iobinfo(format, ...)
#else
# define ioberr (void)
# define iobwarn (void)
# define iobinfo (void)
#endif
#endif /* CONFIG_DEBUG_FEATURES && CONFIG_IOB_DEBUG */ #endif /* CONFIG_DEBUG_FEATURES && CONFIG_IOB_DEBUG */
/**************************************************************************** /****************************************************************************
-12
View File
@@ -61,17 +61,6 @@
/* Debug */ /* Debug */
#ifdef CONFIG_CPP_HAVE_VARARGS
# ifdef CONFIG_DEBUG_GRAM
# define granerr(format, ...) _err(format, ##__VA_ARGS__)
# define granwarn(format, ...) _warn(format, ##__VA_ARGS__)
# define graninfo(format, ...) _info(format, ##__VA_ARGS__)
# else
# define granerr(format, ...) merr(format, ##__VA_ARGS__)
# define granwarn(format, ...) mwarn(format, ##__VA_ARGS__)
# define graninfo(format, ...) minfo(format, ##__VA_ARGS__)
# endif
#else
#ifdef CONFIG_DEBUG_GRAM #ifdef CONFIG_DEBUG_GRAM
# define granerr _err # define granerr _err
# define granwarn _warn # define granwarn _warn
@@ -81,7 +70,6 @@
# define granwarn mwarn # define granwarn mwarn
# define graninfo minfo # define graninfo minfo
#endif #endif
#endif
/**************************************************************************** /****************************************************************************
* Public Types * Public Types
-12
View File
@@ -66,17 +66,6 @@
/* Debug */ /* Debug */
#ifdef CONFIG_CPP_HAVE_VARARGS
# ifdef CONFIG_DEBUG_PGALLOC
# define pgaerr(format, ...) _err(format, ##__VA_ARGS__)
# define pgawarn(format, ...) _warn(format, ##__VA_ARGS__)
# define pgainfo(format, ...) _info(format, ##__VA_ARGS__)
# else
# define pgaerr(format, ...) merr(format, ##__VA_ARGS__)
# define pgawarn(format, ...) mwarn(format, ##__VA_ARGS__)
# define pgainfo(format, ...) minfo(format, ##__VA_ARGS__)
# endif
#else
#ifdef CONFIG_DEBUG_PGALLOC #ifdef CONFIG_DEBUG_PGALLOC
# define pgaerr _err # define pgaerr _err
# define pgawarn _warn # define pgawarn _warn
@@ -86,7 +75,6 @@
# define pgawarn mwarn # define pgawarn mwarn
# define pgainfo minfo # define pgainfo minfo
#endif #endif
#endif
/**************************************************************************** /****************************************************************************
* Private Data * Private Data
+4 -13
View File
@@ -43,6 +43,7 @@
#include <unistd.h> #include <unistd.h>
#include <errno.h> #include <errno.h>
#include <assert.h> #include <assert.h>
#include <debug.h>
#include <nuttx/semaphore.h> #include <nuttx/semaphore.h>
#include <nuttx/mm/mm.h> #include <nuttx/mm/mm.h>
@@ -51,10 +52,6 @@
# include <nuttx/irq.h> # include <nuttx/irq.h>
#endif #endif
#ifdef MONITOR_MM_SEMAPHORE
# include <debug.h>
#endif
/**************************************************************************** /****************************************************************************
* Pre-processor Definitions * Pre-processor Definitions
****************************************************************************/ ****************************************************************************/
@@ -94,15 +91,9 @@
# define msemwarn _warn # define msemwarn _warn
# define mseminfo _info # define mseminfo _info
#else #else
# ifdef CONFIG_CPP_HAVE_VARARGS # define msemerr _none
# define msemerr(x...) # define msemwarn _none
# define msemwarn(x...) # define mseminfo _none
# define mseminfo(x...)
# else
# define msemerr (void)
# define msemwarn (void)
# define mseminfo (void)
# endif
#endif #endif
/**************************************************************************** /****************************************************************************
+2 -12
View File
@@ -78,22 +78,12 @@
# undef IGMP_GRPDEBUG # undef IGMP_GRPDEBUG
#endif #endif
#ifdef CONFIG_CPP_HAVE_VARARGS
# ifdef IGMP_GRPDEBUG
# define grperr(format, ...) nerr(format, ##__VA_ARGS__)
# define grpinfo(format, ...) ninfo(format, ##__VA_ARGS__)
# else
# define grperr(x...)
# define grpinfo(x...)
# endif
#else
#ifdef IGMP_GRPDEBUG #ifdef IGMP_GRPDEBUG
# define grperr nerr # define grperr nerr
# define grpinfo ninfo # define grpinfo ninfo
#else #else
# define grperr (void) # define grperr _none
# define grpinfo (void) # define grpinfo _none
# endif
#endif #endif
/**************************************************************************** /****************************************************************************
+14 -24
View File
@@ -19,21 +19,21 @@
* 2. Redistributions in binary form must reproduce the above copyright * 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the * notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution. * documentation and/or other materials provided with the distribution.
* 3. Neither the name of CITEL Technologies Ltd nor the names of its contributors * 3. Neither the name of CITEL Technologies Ltd nor the names of its
* may be used to endorse or promote products derived from this software * contributors may be used to endorse or promote products derived from
* without specific prior written permission. * this software without specific prior written permission.
* *
* THIS SOFTWARE IS PROVIDED BY CITEL TECHNOLOGIES AND CONTRIBUTORS ``AS IS'' * THIS SOFTWARE IS PROVIDED BY CITEL TECHNOLOGIES AND CONTRIBUTORS ``AS IS''
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL CITEL TECHNOLOGIES OR CONTRIBUTORS BE LIABLE * ARE DISCLAIMED. IN NO EVENT SHALL CITEL TECHNOLOGIES OR CONTRIBUTORS BE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* SUCH DAMAGE. * POSSIBILITY OF SUCH DAMAGE.
* *
****************************************************************************/ ****************************************************************************/
@@ -73,22 +73,12 @@
# undef IGMP_GTMRDEBUG # undef IGMP_GTMRDEBUG
#endif #endif
#ifdef CONFIG_CPP_HAVE_VARARGS
# ifdef IGMP_GTMRDEBUG
# define gtmrerr(format, ...) nerr(format, ##__VA_ARGS__)
# define gtmrinfo(format, ...) ninfo(format, ##__VA_ARGS__)
# else
# define gtmrerr(x...)
# define gtmrinfo(x...)
# endif
#else
#ifdef IGMP_GTMRDEBUG #ifdef IGMP_GTMRDEBUG
# define gtmrerr nerr # define gtmrerr nerr
# define gtmrinfo ninfo # define gtmrinfo ninfo
#else #else
# define gtmrerr (void) # define gtmrerr _none
# define gtmrinfo (void) # define gtmrinfo _none
# endif
#endif #endif
/**************************************************************************** /****************************************************************************
@@ -119,7 +109,7 @@ static void igmp_timeout_work(FAR void *arg)
/* If the group exists and is no an IDLE MEMBER, then it must be a DELAYING /* If the group exists and is no an IDLE MEMBER, then it must be a DELAYING
* member. Race conditions are avoided because (1) the timer is not started * member. Race conditions are avoided because (1) the timer is not started
* until after the first IGMPv2_MEMBERSHIP_REPORT during the join, and (2) * until after the first IGMPv2_MEMBERSHIP_REPORT during the join, and (2)
* the timer is cancelled before sending the IGMP_LEAVE_GROUP during a leave. * the timer is cancelled before sending the IGMP_LEAVE_GROUP during leave.
*/ */
net_lock(); net_lock();
-12
View File
@@ -169,17 +169,6 @@
/* Debug ********************************************************************/ /* Debug ********************************************************************/
#ifdef CONFIG_CPP_HAVE_VARARGS
# ifdef CONFIG_NET_MLD_DEBUG
# define mlderr(format, ...) _err(format, ##__VA_ARGS__)
# define mldwarn(format, ...) _warn(format, ##__VA_ARGS__)
# define mldinfo(format, ...) _info(format, ##__VA_ARGS__)
# else
# define mlderr(format, ...) nerr(format, ##__VA_ARGS__)
# define mldwarn(format, ...) nwarn(format, ##__VA_ARGS__)
# define mldinfo(format, ...) ninfo(format, ##__VA_ARGS__)
# endif
#else
#ifdef CONFIG_NET_MLD_DEBUG #ifdef CONFIG_NET_MLD_DEBUG
# define mlderr _err # define mlderr _err
# define mldwarn _warn # define mldwarn _warn
@@ -189,7 +178,6 @@
# define mldwarn nwarn # define mldwarn nwarn
# define mldinfo ninfo # define mldinfo ninfo
#endif #endif
#endif
/**************************************************************************** /****************************************************************************
* Public Type Definitions * Public Type Definitions