mirror of
https://github.com/apache/nuttx.git
synced 2026-06-04 23:03:27 +08:00
debug: Reduce CONFIG_CPP_HAVE_VARARGS usage
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
@@ -116,18 +116,10 @@
|
||||
|
||||
/* 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
|
||||
# else
|
||||
#else
|
||||
# define message _err
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
@@ -186,7 +178,7 @@ int board_app_initialize(uintptr_t arg)
|
||||
CONFIG_NSH_MMCSDSLOTNO, spi);
|
||||
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);
|
||||
return ret;
|
||||
}
|
||||
|
||||
+7
-11
@@ -82,13 +82,8 @@
|
||||
# define baterr _err
|
||||
# define batreg _err
|
||||
#else
|
||||
# ifdef CONFIG_CPP_HAVE_VARARGS
|
||||
# define baterr(x...)
|
||||
# define batreg(x...)
|
||||
# else
|
||||
# define baterr (void)
|
||||
# define batreg (void)
|
||||
# endif
|
||||
# define baterr _none
|
||||
# define batreg _none
|
||||
#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;
|
||||
int idx;
|
||||
@@ -744,7 +740,7 @@ static int bq2425x_input_current(FAR struct battery_charger_dev_s *dev,
|
||||
ret = bq2425x_powersupply(priv, value);
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -804,7 +800,7 @@ FAR struct battery_charger_dev_s *
|
||||
|
||||
/* 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)
|
||||
{
|
||||
/* Initialize the BQ2425x device structure */
|
||||
@@ -840,7 +836,7 @@ FAR struct battery_charger_dev_s *
|
||||
ret = bq2425x_powersupply(priv, current);
|
||||
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);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
+26
-30
@@ -103,15 +103,9 @@
|
||||
# define batdbg _info
|
||||
# define batinfo _info
|
||||
#else
|
||||
# ifdef CONFIG_CPP_HAVE_VARARGS
|
||||
# define baterr(x...)
|
||||
# define batdbg(x...)
|
||||
# define batinfo(x...)
|
||||
# else
|
||||
# define baterr (void)
|
||||
# define batdbg (void)
|
||||
# define batinfo(void)
|
||||
# endif
|
||||
# define baterr _none
|
||||
# define batdbg _none
|
||||
# define batinfo _none
|
||||
#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,
|
||||
bool state);
|
||||
static int bq2429x_powersupply(FAR struct bq2429x_dev_s *priv, int current);
|
||||
static inline int bq2429x_setvolt(FAR struct bq2429x_dev_s *priv,
|
||||
int volts);
|
||||
static int bq2429x_setvolt(FAR struct bq2429x_dev_s *priv, int volts);
|
||||
static inline int bq2429x_setcurr(FAR struct bq2429x_dev_s *priv,
|
||||
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 */
|
||||
|
||||
regval &= ~(BQ2429XR5_WATCHDOG_MASK);
|
||||
regval |= BQ2429XR5_WATCHDOG_040Sec;
|
||||
regval |= BQ2429XR5_WATCHDOG_040SEC;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -455,7 +448,7 @@ static int bq2429x_syson(FAR struct bq2429x_dev_s *priv)
|
||||
*
|
||||
* Description:
|
||||
* 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
|
||||
*
|
||||
* 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)
|
||||
{
|
||||
case 100:
|
||||
idx = BQ2429XR0_INLIM_0100mA;
|
||||
idx = BQ2429XR0_INLIM_0100MA;
|
||||
break;
|
||||
|
||||
case 150:
|
||||
idx = BQ2429XR0_INLIM_0150mA;
|
||||
idx = BQ2429XR0_INLIM_0150MA;
|
||||
break;
|
||||
|
||||
case 500:
|
||||
idx = BQ2429XR0_INLIM_0500mA;
|
||||
idx = BQ2429XR0_INLIM_0500MA;
|
||||
break;
|
||||
|
||||
case 900:
|
||||
idx = BQ2429XR0_INLIM_0900mA;
|
||||
idx = BQ2429XR0_INLIM_0900MA;
|
||||
break;
|
||||
|
||||
case 1000:
|
||||
idx = BQ2429XR0_INLIM_1000mA;
|
||||
idx = BQ2429XR0_INLIM_1000MA;
|
||||
break;
|
||||
|
||||
case 1500:
|
||||
idx = BQ2429XR0_INLIM_1500mA;
|
||||
idx = BQ2429XR0_INLIM_1500MA;
|
||||
break;
|
||||
|
||||
case 2000:
|
||||
idx = BQ2429XR0_INLIM_2000mA;
|
||||
idx = BQ2429XR0_INLIM_2000MA;
|
||||
break;
|
||||
|
||||
case 3000:
|
||||
idx = BQ2429XR0_INLIM_3000mA;
|
||||
idx = BQ2429XR0_INLIM_3000MA;
|
||||
break;
|
||||
|
||||
default:
|
||||
baterr("ERROR: Current not supported, setting default to 100mA.!\n");
|
||||
idx = BQ2429XR0_INLIM_0100mA;
|
||||
idx = BQ2429XR0_INLIM_0100MA;
|
||||
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;
|
||||
int idx;
|
||||
@@ -1129,8 +1123,9 @@ static int bq2429x_input_current(FAR struct battery_charger_dev_s *dev,
|
||||
*
|
||||
* Description:
|
||||
* Do miscellaneous battery operation. There are numerous options that are
|
||||
* configurable on the bq2429x that go beyond what the NuttX battery charger
|
||||
* API provide access to. This operate() function allows changing some of them.
|
||||
* configurable on the bq2429x that go beyond what the NuttX battery
|
||||
* charger API provide access to. This operate() function allows changing
|
||||
* some of them.
|
||||
*
|
||||
* REG00 EN_HIZ
|
||||
* 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)
|
||||
{
|
||||
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 value;
|
||||
int ret = OK;
|
||||
@@ -1194,7 +1190,7 @@ static int bq2429x_operate(FAR struct battery_charger_dev_s *dev,
|
||||
case BATIO_OPRTN_HIZ:
|
||||
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;
|
||||
|
||||
@@ -1258,7 +1254,7 @@ FAR struct battery_charger_dev_s *
|
||||
|
||||
/* 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)
|
||||
{
|
||||
/* Initialize the BQ2429x device structure */
|
||||
@@ -1294,7 +1290,7 @@ FAR struct battery_charger_dev_s *
|
||||
ret = bq2429x_powersupply(priv, current);
|
||||
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);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
+38
-45
@@ -83,15 +83,9 @@
|
||||
# define batreg _err
|
||||
# define batinfo _info
|
||||
#else
|
||||
# ifdef CONFIG_CPP_HAVE_VARARGS
|
||||
# define baterr(x...)
|
||||
# define batreg(x...)
|
||||
# define batinfo(x...)
|
||||
# else
|
||||
# define baterr(void)
|
||||
# define batreg(void)
|
||||
# define batinfo(void)
|
||||
# endif
|
||||
# define baterr _none
|
||||
# define batreg _none
|
||||
# define batinfo _none
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
@@ -255,26 +249,25 @@ static int bq769x0_getnreg16(FAR struct bq769x0_dev_s *priv, uint8_t regaddr,
|
||||
|
||||
/* 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);
|
||||
static inline int bq769x0_getvolt(FAR struct bq769x0_dev_s *priv,
|
||||
FAR int *volts);
|
||||
static inline int bq769x0_getcurrent(FAR struct bq769x0_dev_s *priv,
|
||||
static int bq769x0_getvolt(FAR struct bq769x0_dev_s *priv, FAR int *volts);
|
||||
static int bq769x0_getcurrent(FAR struct bq769x0_dev_s *priv,
|
||||
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);
|
||||
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);
|
||||
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);
|
||||
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_doshutdown(FAR struct bq769x0_dev_s *priv);
|
||||
static int bq769x0_setlimits(FAR struct bq769x0_dev_s *priv,
|
||||
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);
|
||||
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);
|
||||
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);
|
||||
|
||||
/* Battery driver lower half methods */
|
||||
@@ -368,7 +361,7 @@ static int bq769x0_getreg8(FAR struct bq769x0_dev_s *priv, uint8_t regaddr,
|
||||
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)
|
||||
{
|
||||
@@ -441,7 +434,7 @@ static int bq769x0_putreg8(FAR struct bq769x0_dev_s *priv, uint8_t regaddr,
|
||||
buffer[0] = regaddr;
|
||||
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)
|
||||
{
|
||||
@@ -540,7 +533,7 @@ static int bq769x0_getnreg16(FAR struct bq769x0_dev_s *priv, uint8_t regaddr,
|
||||
|
||||
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)
|
||||
{
|
||||
@@ -584,7 +577,7 @@ static int bq769x0_getnreg16(FAR struct bq769x0_dev_s *priv, uint8_t regaddr,
|
||||
crc = 0;
|
||||
}
|
||||
|
||||
/* Copy 16-bit values to be returned, skipping CRC bytes*/
|
||||
/* Copy 16-bit values to be returned, skipping CRC bytes */
|
||||
|
||||
for (i = 0; i < datalen; i += 4)
|
||||
{
|
||||
@@ -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,
|
||||
uint8_t *report)
|
||||
static int bq769x0_getreport(FAR struct bq769x0_dev_s *priv,
|
||||
FAR uint8_t *report)
|
||||
{
|
||||
uint8_t regval = 0;
|
||||
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;
|
||||
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;
|
||||
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,
|
||||
struct battery_monitor_limits_s *limits)
|
||||
static int bq769x0_setlimits(FAR struct bq769x0_dev_s *priv,
|
||||
FAR struct battery_monitor_limits_s *limits)
|
||||
{
|
||||
int ret;
|
||||
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,
|
||||
struct battery_monitor_switches_s *sw)
|
||||
static int bq769x0_setchgdsg(FAR struct bq769x0_dev_s *priv,
|
||||
FAR struct battery_monitor_switches_s *sw)
|
||||
{
|
||||
int ret;
|
||||
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)
|
||||
{
|
||||
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;
|
||||
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,
|
||||
struct battery_monitor_voltage_s *voltages)
|
||||
static int bq769x0_getcellvolt(FAR struct bq769x0_dev_s *priv,
|
||||
FAR struct battery_monitor_voltage_s *voltages)
|
||||
{
|
||||
uint16_t regvals[BQ769X0_MAX_CELLS];
|
||||
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,
|
||||
struct battery_monitor_temperature_s *temps)
|
||||
static int bq769x0_gettemperature(FAR struct bq769x0_dev_s *priv,
|
||||
FAR struct battery_monitor_temperature_s *temps)
|
||||
{
|
||||
int chip_sensors;
|
||||
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)
|
||||
{
|
||||
/* 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,
|
||||
struct battery_monitor_balance_s *bal)
|
||||
static int bq769x0_setbalance(FAR struct bq769x0_dev_s *priv,
|
||||
FAR struct battery_monitor_balance_s *bal)
|
||||
{
|
||||
int i;
|
||||
int j;
|
||||
@@ -1726,7 +1719,7 @@ static inline int bq769x0_setbalance(FAR struct bq769x0_dev_s *priv,
|
||||
}
|
||||
}
|
||||
|
||||
/* Now split the result into 3 groups of 5 and send*/
|
||||
/* Now split the result into 3 groups of 5 and send */
|
||||
|
||||
for (i = 0; i < BQ769X0_BAL_REG_COUNT; i += 1)
|
||||
{
|
||||
@@ -1922,7 +1915,7 @@ static int bq769x0_shutdown(struct battery_monitor_dev_s *dev,
|
||||
ret = bq769x0_doshutdown(priv);
|
||||
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);
|
||||
return ret;
|
||||
}
|
||||
@@ -2100,7 +2093,7 @@ FAR struct battery_monitor_dev_s *
|
||||
|
||||
/* 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)
|
||||
{
|
||||
/* Initialize the BQ769x0 device structure */
|
||||
|
||||
+38
-39
@@ -34,10 +34,10 @@
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
/* "The MAX17040/MAX17041 are ultra-compact, low-cost, host-side fuel-gauge
|
||||
* systems for lithium-ion (Li+) batteries in handheld and portable equipment.
|
||||
* The MAX17040 is configured to operate with a single lithium cell and the
|
||||
* MAX17041 is configured for a dual-cell 2S pack.
|
||||
/* "MAX17040/MAX17041 are ultra-compact, low-cost, host-side fuel-gauge
|
||||
* systems for lithium-ion (Li+) batteries in handheld and portable
|
||||
* equipment. MAX17040 is configured to operate with a single lithium cell
|
||||
* and the MAX17041 is configured for a dual-cell 2S pack.
|
||||
*/
|
||||
|
||||
/****************************************************************************
|
||||
@@ -83,14 +83,14 @@
|
||||
|
||||
/* MAX1704x Register Definitions ********************************************/
|
||||
|
||||
/* "All host interaction with the MAX17040/MAX17041 is handled by writing to
|
||||
* and reading from register locations. The MAX17040/MAX17041 have six 16-bit
|
||||
/* "All host interaction with MAX17040/MAX17041 is handled by writing to
|
||||
* and reading from register locations. MAX17040/MAX17041 have six 16-bit
|
||||
* registers: SOC, VCELL, MODE, VERSION, RCOMP, and COMMAND. Register reads
|
||||
* and writes are only valid if all 16 bits are transferred..."
|
||||
*/
|
||||
|
||||
/* "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..."
|
||||
*/
|
||||
|
||||
@@ -111,8 +111,8 @@
|
||||
#endif
|
||||
|
||||
/* "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
|
||||
* result is displayed as a percentage of the cell’s full capacity...
|
||||
* state of charge of the cell as calculated by the ModelGauge algorithm.
|
||||
* The result is displayed as a percentage of the cell’s full capacity...
|
||||
*
|
||||
* "...Units of % can be directly determined by observing only the high byte
|
||||
* of the SOC register. The low byte provides additional resolution in units
|
||||
@@ -137,7 +137,7 @@
|
||||
#define MAX1407X_MODE_QUICKSTART 0x4000
|
||||
|
||||
/* "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 */
|
||||
@@ -165,11 +165,7 @@
|
||||
#ifdef CONFIG_DEBUG_MAX1704X
|
||||
# define baterr _err
|
||||
#else
|
||||
# ifdef CONFIG_CPP_HAVE_VARARGS
|
||||
# define baterr(x...)
|
||||
# else
|
||||
# define baterr (void)
|
||||
# endif
|
||||
# define baterr _none
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
@@ -196,10 +192,10 @@ struct max1704x_dev_s
|
||||
|
||||
/* I2C support */
|
||||
|
||||
static int max1704x_getreg16(FAR struct max1704x_dev_s *priv, uint8_t regaddr,
|
||||
FAR uint16_t *regval);
|
||||
static int max1704x_putreg16(FAR struct max1704x_dev_s *priv, uint8_t regaddr,
|
||||
uint16_t regval);
|
||||
static int max1704x_getreg16(FAR struct max1704x_dev_s *priv,
|
||||
uint8_t regaddr, FAR uint16_t *regval);
|
||||
static int max1704x_putreg16(FAR struct max1704x_dev_s *priv,
|
||||
uint8_t regaddr, uint16_t regval);
|
||||
|
||||
static inline int max1704x_getvcell(FAR struct max1704x_dev_s *priv,
|
||||
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,
|
||||
FAR uint16_t *regval)
|
||||
static int max1704x_getreg16(FAR struct max1704x_dev_s *priv,
|
||||
uint8_t regaddr, FAR uint16_t *regval)
|
||||
{
|
||||
struct i2c_config_s config;
|
||||
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,
|
||||
uint16_t regval)
|
||||
static int max1704x_putreg16(FAR struct max1704x_dev_s *priv,
|
||||
uint8_t regaddr, uint16_t regval)
|
||||
{
|
||||
struct i2c_config_s config;
|
||||
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)
|
||||
{
|
||||
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);
|
||||
}
|
||||
@@ -405,13 +403,14 @@ static inline int max1704x_setrcomp(FAR struct max1704x_dev_s *priv, uint16_t rc
|
||||
* Name: max1704x_reset
|
||||
*
|
||||
* Description:
|
||||
* Reset the MAX1704x
|
||||
* Reset MAX1704x
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
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
|
||||
*
|
||||
* 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();
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* Input Parameters:
|
||||
* i2c - An instance of the I2C interface to use to communicate with the MAX1704x
|
||||
* addr - The I2C address of the MAX1704x (Better be 0x36).
|
||||
* i2c - An instance of the I2C interface to communicate with MAX1704x
|
||||
* addr - The I2C address of MAX1704x (Better be 0x36).
|
||||
* frequency - The I2C frequency
|
||||
*
|
||||
* Returned Value:
|
||||
* 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,
|
||||
uint8_t addr,
|
||||
uint32_t frequency)
|
||||
FAR struct battery_gauge_dev_s *
|
||||
max1704x_initialize(FAR struct i2c_master_s *i2c,
|
||||
uint8_t addr, uint32_t frequency)
|
||||
{
|
||||
FAR struct max1704x_dev_s *priv;
|
||||
#if 0
|
||||
int ret;
|
||||
#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)
|
||||
{
|
||||
/* Initialize the MAX1704x device structure */
|
||||
/* Initialize MAX1704x device structure */
|
||||
|
||||
nxsem_init(&priv->batsem, 0, 1);
|
||||
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->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
|
||||
ret = max1704x_reset(priv);
|
||||
if (ret < 0)
|
||||
{
|
||||
baterr("Failed to reset the MAX1704x: %d\n", ret);
|
||||
baterr("Failed to reset MAX1704x: %d\n", ret);
|
||||
kmm_free(priv);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -78,13 +78,8 @@
|
||||
# define baterr _err
|
||||
# define batreg _err
|
||||
#else
|
||||
# ifdef CONFIG_CPP_HAVE_VARARGS
|
||||
# define baterr(x...)
|
||||
# define batreg(x...)
|
||||
# else
|
||||
# define baterr (void)
|
||||
# define batreg (void)
|
||||
# endif
|
||||
# define baterr _none
|
||||
# define batreg _none
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
|
||||
@@ -68,32 +68,16 @@
|
||||
|
||||
#undef cserr
|
||||
#ifdef CONFIG_CS2100CP_DEBUG
|
||||
# ifdef CONFIG_CPP_HAVE_VARARGS
|
||||
# define cserr(format, ...) _err(format, ##__VA_ARGS__)
|
||||
# else
|
||||
# define cserr _err
|
||||
# endif
|
||||
#else
|
||||
# ifdef CONFIG_CPP_HAVE_VARARGS
|
||||
# define cserr(x...)
|
||||
# else
|
||||
# define cserr (void)
|
||||
# endif
|
||||
# define cserr _none
|
||||
#endif
|
||||
|
||||
#undef reginfo
|
||||
#ifdef CONFIG_CS2100CP_REGDEBUG
|
||||
# ifdef CONFIG_CPP_HAVE_VARARGS
|
||||
# define reginfo(format, ...) _err(format, ##__VA_ARGS__)
|
||||
# else
|
||||
# define reginfo _err
|
||||
# endif
|
||||
#else
|
||||
# ifdef CONFIG_CPP_HAVE_VARARGS
|
||||
# define reginfo(x...)
|
||||
# else
|
||||
# define reginfo (void)
|
||||
# endif
|
||||
# define reginfo _none
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/****************************************************************************
|
||||
* fs/spiffs.h/spiffs_cache.h
|
||||
* fs/spiffs/src/spiffs_cache.h
|
||||
*
|
||||
* Copyright (C) 2018 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
@@ -77,17 +77,9 @@ extern "C"
|
||||
/* Debug */
|
||||
|
||||
#ifdef CONFIG_SPIFFS_CACHEDBG
|
||||
# ifdef CONFIG_CPP_HAVE_VARARGS
|
||||
# define spiffs_cacheinfo(format, ...) _info(format, ##__VA_ARGS__)
|
||||
# else
|
||||
# define spiffs_cacheinfo _info
|
||||
# endif
|
||||
#else
|
||||
# ifdef CONFIG_CPP_HAVE_VARARGS
|
||||
# define spiffs_cacheinfo(format, ...)
|
||||
# else
|
||||
# define spiffs_cacheinfo (void)
|
||||
# endif
|
||||
# define spiffs_cacheinfo _none
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/****************************************************************************
|
||||
* fs/spiffs.h/spiffs_check.h
|
||||
* fs/spiffs/src/spiffs_check.h
|
||||
*
|
||||
* Copyright (C) 2018 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
@@ -55,19 +55,13 @@ extern "C"
|
||||
|
||||
/* Consistency check output */
|
||||
|
||||
#ifdef CONFIG_SPIFFS_CHECK_OUTPUT
|
||||
# ifdef CONFIG_CPP_HAVE_VARARGS
|
||||
#if !defined(CONFIG_SPIFFS_CHECK_OUTPUT)
|
||||
# define spiffs_checkinfo _none
|
||||
#elif defined(CONFIG_CPP_HAVE_VARARGS)
|
||||
# define spiffs_checkinfo(format, ...) \
|
||||
syslog(LOG_NOTICE, "SPIFFS: " format, ##__VA_ARGS__)
|
||||
# else
|
||||
# define spiffs_checkinfo _info
|
||||
# endif
|
||||
#else
|
||||
# ifdef CONFIG_CPP_HAVE_VARARGS
|
||||
# define spiffs_checkinfo(format, ...)
|
||||
# else
|
||||
# define spiffs_checkinfo (void)
|
||||
# endif
|
||||
# define spiffs_checkinfo _info
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
@@ -114,7 +108,8 @@ int spiffs_check_luconsistency(FAR struct spiffs_s *fs);
|
||||
* - x011 used, referenced only once, not 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:
|
||||
* 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);
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
* Name: spiffs_dump
|
||||
*
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/****************************************************************************
|
||||
* fs/spiffs.h/spiffs_gc.h
|
||||
* fs/spiffs/src/spiffs_gc.h
|
||||
*
|
||||
* Copyright (C) 2018 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
@@ -56,17 +56,9 @@ extern "C"
|
||||
/* Debug */
|
||||
|
||||
#ifdef CONFIG_SPIFFS_GCDBG
|
||||
# ifdef CONFIG_CPP_HAVE_VARARGS
|
||||
# define spiffs_gcinfo(format, ...) _info(format, ##__VA_ARGS__)
|
||||
# else
|
||||
# define spiffs_gcinfo _info
|
||||
# endif
|
||||
#else
|
||||
# ifdef CONFIG_CPP_HAVE_VARARGS
|
||||
# define spiffs_gcinfo(format, ...)
|
||||
# else
|
||||
# define spiffs_gcinfo (void)
|
||||
# endif
|
||||
# define spiffs_gcinfo _none
|
||||
#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.
|
||||
*
|
||||
* NB: the garbage collector is automatically called when spiffs needs free
|
||||
* pages. The reason for this function is to give possibility to do background
|
||||
* tidying when user knows the system is idle.
|
||||
* pages. The reason for this function is to give possibility to do
|
||||
* background tidying when user knows the system is idle.
|
||||
*
|
||||
* Input Parameters:
|
||||
* fs the file system struct
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/****************************************************************************
|
||||
* fs/spiffs.h/spiffs_mtd.h
|
||||
* fs/spiffs/src/spiffs_mtd.h
|
||||
*
|
||||
* Copyright (C) 2018 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
@@ -69,17 +69,9 @@ extern "C"
|
||||
/* Debug */
|
||||
|
||||
#ifdef CONFIG_SPIFFS_MTDDBG
|
||||
# ifdef CONFIG_CPP_HAVE_VARARGS
|
||||
# define spiffs_mtdinfo(format, ...) _info(format, ##__VA_ARGS__)
|
||||
# else
|
||||
# define spiffs_mtdinfo _info
|
||||
# endif
|
||||
#else
|
||||
# ifdef CONFIG_CPP_HAVE_VARARGS
|
||||
# define spiffs_mtdinfo(format, ...)
|
||||
# else
|
||||
# define spiffs_mtdinfo (void)
|
||||
# endif
|
||||
# define spiffs_mtdinfo _none
|
||||
#endif
|
||||
|
||||
/* Commonly used Macros */
|
||||
|
||||
@@ -181,25 +181,13 @@
|
||||
/* 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 updwarn _warn
|
||||
# define updinfo _info
|
||||
# endif
|
||||
#else
|
||||
# ifdef CONFIG_CPP_HAVE_VARARGS
|
||||
# define upderr(x...)
|
||||
# define updwarn(x...)
|
||||
# define updinfo(x...)
|
||||
# else
|
||||
# define upderr (void)
|
||||
# define updwarn (void)
|
||||
# define updinfo (void)
|
||||
# endif
|
||||
# define upderr _none
|
||||
# define updwarn _none
|
||||
# define updinfo _none
|
||||
#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);
|
||||
|
||||
#undef EXTERN
|
||||
|
||||
+121
-727
File diff suppressed because it is too large
Load Diff
@@ -72,11 +72,7 @@
|
||||
*/
|
||||
|
||||
#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
|
||||
# endif
|
||||
# define _NX_CLOSE(f) nx_close(f)
|
||||
# define _NX_READ(f,b,s) nx_read(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_GETERRVAL(r) (r)
|
||||
#else
|
||||
# ifdef CONFIG_CPP_HAVE_VARARGS
|
||||
# define _NX_OPEN(p,f,...) open(p,f,##__VA_ARGS__)
|
||||
# else
|
||||
# define _NX_OPEN open
|
||||
# endif
|
||||
# define _NX_CLOSE(f) close(f)
|
||||
# define _NX_READ(f,b,s) read(f,b,s)
|
||||
# define _NX_WRITE(f,b,s) write(f,b,s)
|
||||
|
||||
+5
-14
@@ -51,6 +51,7 @@
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
|
||||
/* Configuration ************************************************************/
|
||||
|
||||
#ifndef CONFIG_ARCH_ADDRENV
|
||||
@@ -71,22 +72,12 @@
|
||||
|
||||
/* 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 shminfo _info
|
||||
# else
|
||||
# define shmerr (void)
|
||||
# define shminfo (void)
|
||||
# endif
|
||||
#else
|
||||
# define shmerr merr
|
||||
# define shminfo minfo
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
|
||||
@@ -51,7 +51,7 @@
|
||||
#define BQ2429X_CURRCHG_MIN 512
|
||||
#define BQ2429X_CURRCHG_MAX 3008
|
||||
|
||||
/* BQ2429X Register Definitions ********************************************/
|
||||
/* BQ2429X Register Definitions *********************************************/
|
||||
#define BQ2429X_REG00 0x00
|
||||
#define BQ2429X_REG01 0x01
|
||||
#define BQ2429X_REG02 0x02
|
||||
@@ -66,12 +66,13 @@
|
||||
|
||||
/* REG00 Input Source Control Register */
|
||||
|
||||
/* For enabling Device Shutdown for shipping - EN_HIZ=1 until QON pressed*/
|
||||
/* For enabling Device Shutdown for shipping - EN_HIZ=1 until QON pressed */
|
||||
#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]
|
||||
VINDPM - Input Voltage threshold (a drop below 5V) that triggers DPM
|
||||
INLIM - Input current threshold that triggers DPM */
|
||||
* VINDPM - Input Voltage threshold (a drop below 5V) that triggers DPM
|
||||
* INLIM - Input current threshold that triggers DPM
|
||||
*/
|
||||
|
||||
#define BQ2429XR0_VINDPM_SHIFT 3 /* VIN DPM Offset 5V? Range*/
|
||||
#define BQ2429XR0_VINDPM_MASK (0xf << BQ2429XR0_VINDPM_SHIFT)
|
||||
@@ -81,14 +82,14 @@
|
||||
# define BQ2429XR0_VINDPM0_640mV (8 << BQ2429XR0_VINDPM_SHIFT)
|
||||
#define BQ2429XR0_INLIM_SHIFT 0 /* Input Current Limit - lower of I2C & ILIM */
|
||||
#define BQ2429XR0_INLIM_MASK (0x7 << BQ2429XR0_INLIM_SHIFT)
|
||||
# define BQ2429XR0_INLIM_0100mA (0x0 << BQ2429XR0_INLIM_SHIFT)
|
||||
# define BQ2429XR0_INLIM_0150mA (0x1 << BQ2429XR0_INLIM_SHIFT)
|
||||
# define BQ2429XR0_INLIM_0500mA (0x2 << BQ2429XR0_INLIM_SHIFT)
|
||||
# define BQ2429XR0_INLIM_0900mA (0x3 << BQ2429XR0_INLIM_SHIFT)
|
||||
# define BQ2429XR0_INLIM_1000mA (0x4 << BQ2429XR0_INLIM_SHIFT)
|
||||
# define BQ2429XR0_INLIM_1500mA (0x5 << BQ2429XR0_INLIM_SHIFT)
|
||||
# define BQ2429XR0_INLIM_2000mA (0x6 << BQ2429XR0_INLIM_SHIFT)
|
||||
# define BQ2429XR0_INLIM_3000mA (0x7 << BQ2429XR0_INLIM_SHIFT)
|
||||
# define BQ2429XR0_INLIM_0100MA (0x0 << BQ2429XR0_INLIM_SHIFT)
|
||||
# define BQ2429XR0_INLIM_0150MA (0x1 << BQ2429XR0_INLIM_SHIFT)
|
||||
# define BQ2429XR0_INLIM_0500MA (0x2 << BQ2429XR0_INLIM_SHIFT)
|
||||
# define BQ2429XR0_INLIM_0900MA (0x3 << BQ2429XR0_INLIM_SHIFT)
|
||||
# define BQ2429XR0_INLIM_1000MA (0x4 << BQ2429XR0_INLIM_SHIFT)
|
||||
# define BQ2429XR0_INLIM_1500MA (0x5 << BQ2429XR0_INLIM_SHIFT)
|
||||
# define BQ2429XR0_INLIM_2000MA (0x6 << BQ2429XR0_INLIM_SHIFT)
|
||||
# define BQ2429XR0_INLIM_3000MA (0x7 << BQ2429XR0_INLIM_SHIFT)
|
||||
|
||||
/* 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_MASK (0xf << BQ2429XR3_IPRECHG_SHIFT)
|
||||
#define BQ2429XR3_IPRECHG_0128mA (0x00 << BQ2429XR3_IPRECHG_SHIFT)
|
||||
#define BQ2429XR3_IPRECHG_0128mA (0x01 << BQ2429XR3_IPRECHG_SHIFT)
|
||||
#define BQ2429XR3_IPRECHG_0256mA (0x02 << BQ2429XR3_IPRECHG_SHIFT)
|
||||
#define BQ2429XR3_IPRECHG_0384mA (0x03 << BQ2429XR3_IPRECHG_SHIFT)
|
||||
#define BQ2429XR3_IPRECHG_0512mA (0x04 << BQ2429XR3_IPRECHG_SHIFT)
|
||||
#define BQ2429XR3_IPRECHG_0768mA (0x05 << BQ2429XR3_IPRECHG_SHIFT)
|
||||
#define BQ2429XR3_IPRECHG_0896mA (0x06 << BQ2429XR3_IPRECHG_SHIFT)
|
||||
#define BQ2429XR3_IPRECHG_1024mA (0x07 << BQ2429XR3_IPRECHG_SHIFT)
|
||||
#define BQ2429XR3_IPRECHG_1152mA (0x10 << BQ2429XR3_IPRECHG_SHIFT)
|
||||
#define BQ2429XR3_IPRECHG_1280mA (0x11 << BQ2429XR3_IPRECHG_SHIFT)
|
||||
#define BQ2429XR3_IPRECHG_1408mA (0x12 << BQ2429XR3_IPRECHG_SHIFT)
|
||||
#define BQ2429XR3_IPRECHG_1536mA (0x13 << BQ2429XR3_IPRECHG_SHIFT)
|
||||
#define BQ2429XR3_IPRECHG_1664mA (0x14 << BQ2429XR3_IPRECHG_SHIFT)
|
||||
#define BQ2429XR3_IPRECHG_1792mA (0x15 << BQ2429XR3_IPRECHG_SHIFT)
|
||||
#define BQ2429XR3_IPRECHG_1920mA (0x16 << BQ2429XR3_IPRECHG_SHIFT)
|
||||
#define BQ2429XR3_IPRECHG_2048mA (0x17 << BQ2429XR3_IPRECHG_SHIFT)
|
||||
#define BQ2429XR3_IPRECHG_0128MA (0x00 << BQ2429XR3_IPRECHG_SHIFT)
|
||||
#define BQ2429XR3_IPRECHG_0128MA (0x01 << BQ2429XR3_IPRECHG_SHIFT)
|
||||
#define BQ2429XR3_IPRECHG_0256MA (0x02 << BQ2429XR3_IPRECHG_SHIFT)
|
||||
#define BQ2429XR3_IPRECHG_0384MA (0x03 << BQ2429XR3_IPRECHG_SHIFT)
|
||||
#define BQ2429XR3_IPRECHG_0512MA (0x04 << BQ2429XR3_IPRECHG_SHIFT)
|
||||
#define BQ2429XR3_IPRECHG_0768MA (0x05 << BQ2429XR3_IPRECHG_SHIFT)
|
||||
#define BQ2429XR3_IPRECHG_0896MA (0x06 << BQ2429XR3_IPRECHG_SHIFT)
|
||||
#define BQ2429XR3_IPRECHG_1024MA (0x07 << BQ2429XR3_IPRECHG_SHIFT)
|
||||
#define BQ2429XR3_IPRECHG_1152MA (0x10 << BQ2429XR3_IPRECHG_SHIFT)
|
||||
#define BQ2429XR3_IPRECHG_1280MA (0x11 << BQ2429XR3_IPRECHG_SHIFT)
|
||||
#define BQ2429XR3_IPRECHG_1408MA (0x12 << BQ2429XR3_IPRECHG_SHIFT)
|
||||
#define BQ2429XR3_IPRECHG_1536MA (0x13 << BQ2429XR3_IPRECHG_SHIFT)
|
||||
#define BQ2429XR3_IPRECHG_1664MA (0x14 << BQ2429XR3_IPRECHG_SHIFT)
|
||||
#define BQ2429XR3_IPRECHG_1792MA (0x15 << BQ2429XR3_IPRECHG_SHIFT)
|
||||
#define BQ2429XR3_IPRECHG_1920MA (0x16 << 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_MASK (0xf << BQ2429XR3_ITERM_SHIFT)
|
||||
#define BQ2429XR3_ITERM0_128mA (1 << BQ2429XR3_ITERM_SHIFT)
|
||||
#define BQ2429XR3_ITERM0_256mA (2 << 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_128MA (1 << BQ2429XR3_ITERM_SHIFT)
|
||||
#define BQ2429XR3_ITERM0_256MA (2 << BQ2429XR3_ITERM_SHIFT)
|
||||
#define BQ2429XR3_ITERM0_512MA (4 << BQ2429XR3_ITERM_SHIFT)
|
||||
#define BQ2429XR3_ITERM0_1024MA (8 << BQ2429XR3_ITERM_SHIFT) /* Reserved in BQ24296M */
|
||||
|
||||
/* REG04 Charge Voltage Control Register */
|
||||
#define BQ2429XR4_VREG_SHIFT 2 /* Offset 3.504V Range 3.504-4.400V Default 4.208V */
|
||||
@@ -154,12 +155,12 @@
|
||||
#define BQ2429XR5_WATCHDOG_SHIFT 4 /* Watchdog Timer Settings */
|
||||
#define BQ2429XR5_WATCHDOG_MASK (3 << BQ2429XR5_WATCHDOG_SHIFT)
|
||||
# define BQ2429XR5_WATCHDOG_DIS (0 << BQ2429XR5_WATCHDOG_SHIFT)
|
||||
# define BQ2429XR5_WATCHDOG_040Sec (1 << BQ2429XR5_WATCHDOG_SHIFT)
|
||||
# define BQ2429XR5_WATCHDOG_080Sec (2 << BQ2429XR5_WATCHDOG_SHIFT)
|
||||
# define BQ2429XR5_WATCHDOG_160Sec (3 << BQ2429XR5_WATCHDOG_SHIFT)
|
||||
# define BQ2429XR5_WATCHDOG_040SEC (1 << BQ2429XR5_WATCHDOG_SHIFT)
|
||||
# define BQ2429XR5_WATCHDOG_080SEC (2 << BQ2429XR5_WATCHDOG_SHIFT)
|
||||
# define BQ2429XR5_WATCHDOG_160SEC (3 << BQ2429XR5_WATCHDOG_SHIFT)
|
||||
|
||||
#define BQ2429XR5_EN_TIMER (1 << 3) /* 0=Disable 1=Enable(default) */
|
||||
/* Fast Charge Timer Settings */
|
||||
/* Fast Charge Timer Settings */
|
||||
#define BQ2429XR5_CHG_TIMER_SHIFT 1
|
||||
#define BQ2429XR5_CHG_TIMER_MASK (3 << BQ2429XR5_CHG_TIMER_SHIFT)
|
||||
# define BQ2429XR5_CHG_TIMER_05hrs (0 << BQ2429XR5_CHG_TIMER_SHIFT)
|
||||
|
||||
+4
-3
@@ -1,4 +1,8 @@
|
||||
"__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"
|
||||
"abs","stdlib.h","","int","int"
|
||||
"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_remfirst","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 *"
|
||||
"fclose","stdio.h","CONFIG_NFILE_STREAMS > 0","int","FAR FILE *"
|
||||
"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"
|
||||
"ungetc","stdio.h","CONFIG_NFILE_STREAMS > 0","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"
|
||||
"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"
|
||||
@@ -234,4 +236,3 @@
|
||||
"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"
|
||||
"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 *","..."
|
||||
|
||||
|
+3
-23
@@ -54,33 +54,13 @@
|
||||
****************************************************************************/
|
||||
|
||||
#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 iobwarn _warn
|
||||
# define iobinfo _info
|
||||
|
||||
#endif
|
||||
#else
|
||||
#ifdef CONFIG_CPP_HAVE_VARARGS
|
||||
|
||||
# define ioberr(format, ...)
|
||||
# define iobwarn(format, ...)
|
||||
# define iobinfo(format, ...)
|
||||
|
||||
#else
|
||||
|
||||
# define ioberr (void)
|
||||
# define iobwarn (void)
|
||||
# define iobinfo (void)
|
||||
|
||||
#endif
|
||||
# define ioberr _none
|
||||
# define iobwarn _none
|
||||
# define iobinfo _none
|
||||
#endif /* CONFIG_DEBUG_FEATURES && CONFIG_IOB_DEBUG */
|
||||
|
||||
/****************************************************************************
|
||||
|
||||
+2
-14
@@ -61,26 +61,14 @@
|
||||
|
||||
/* 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 granwarn _warn
|
||||
# define graninfo _info
|
||||
# else
|
||||
#else
|
||||
# define granerr merr
|
||||
# define granwarn mwarn
|
||||
# define graninfo minfo
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
|
||||
+2
-14
@@ -66,26 +66,14 @@
|
||||
|
||||
/* 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 pgawarn _warn
|
||||
# define pgainfo _info
|
||||
# else
|
||||
#else
|
||||
# define pgaerr merr
|
||||
# define pgawarn mwarn
|
||||
# define pgainfo minfo
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
|
||||
+4
-13
@@ -43,6 +43,7 @@
|
||||
#include <unistd.h>
|
||||
#include <errno.h>
|
||||
#include <assert.h>
|
||||
#include <debug.h>
|
||||
|
||||
#include <nuttx/semaphore.h>
|
||||
#include <nuttx/mm/mm.h>
|
||||
@@ -51,10 +52,6 @@
|
||||
# include <nuttx/irq.h>
|
||||
#endif
|
||||
|
||||
#ifdef MONITOR_MM_SEMAPHORE
|
||||
# include <debug.h>
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
@@ -94,15 +91,9 @@
|
||||
# define msemwarn _warn
|
||||
# define mseminfo _info
|
||||
#else
|
||||
# ifdef CONFIG_CPP_HAVE_VARARGS
|
||||
# define msemerr(x...)
|
||||
# define msemwarn(x...)
|
||||
# define mseminfo(x...)
|
||||
# else
|
||||
# define msemerr (void)
|
||||
# define msemwarn (void)
|
||||
# define mseminfo (void)
|
||||
# endif
|
||||
# define msemerr _none
|
||||
# define msemwarn _none
|
||||
# define mseminfo _none
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
|
||||
+4
-14
@@ -78,22 +78,12 @@
|
||||
# undef IGMP_GRPDEBUG
|
||||
#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 grpinfo ninfo
|
||||
# else
|
||||
# define grperr (void)
|
||||
# define grpinfo (void)
|
||||
# endif
|
||||
#else
|
||||
# define grperr _none
|
||||
# define grpinfo _none
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
|
||||
+16
-26
@@ -19,21 +19,21 @@
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of CITEL Technologies Ltd nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
* 3. Neither the name of CITEL Technologies Ltd nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY CITEL TECHNOLOGIES AND CONTRIBUTORS ``AS IS''
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL CITEL TECHNOLOGIES OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL CITEL TECHNOLOGIES OR CONTRIBUTORS BE
|
||||
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
@@ -73,22 +73,12 @@
|
||||
# undef IGMP_GTMRDEBUG
|
||||
#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 gtmrinfo ninfo
|
||||
# else
|
||||
# define gtmrerr (void)
|
||||
# define gtmrinfo (void)
|
||||
# endif
|
||||
#else
|
||||
# define gtmrerr _none
|
||||
# define gtmrinfo _none
|
||||
#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
|
||||
* member. Race conditions are avoided because (1) the timer is not started
|
||||
* 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();
|
||||
|
||||
+2
-14
@@ -169,26 +169,14 @@
|
||||
|
||||
/* 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 mldwarn _warn
|
||||
# define mldinfo _info
|
||||
# else
|
||||
#else
|
||||
# define mlderr nerr
|
||||
# define mldwarn nwarn
|
||||
# define mldinfo ninfo
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
|
||||
Reference in New Issue
Block a user