mirror of
https://github.com/apache/nuttx.git
synced 2026-06-01 07:45:16 +08:00
boards/sim: Fix watchdog callback
drivers: Fix types and sx127x driver rx net/pkt: Fix type Small fixes. Signed-off-by: Bartosz <bartol2205@gmail.com>
This commit is contained in:
committed by
Xiang Xiao
parent
5051721298
commit
585d954d0b
@@ -131,7 +131,7 @@ static struct simgpint_dev_s g_gpint =
|
|||||||
* Private Functions
|
* Private Functions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
static int sim_interrupt(wdparm_t arg)
|
static void sim_interrupt(wdparm_t arg)
|
||||||
{
|
{
|
||||||
struct simgpint_dev_s *simgpint = (struct simgpint_dev_s *)arg;
|
struct simgpint_dev_s *simgpint = (struct simgpint_dev_s *)arg;
|
||||||
|
|
||||||
@@ -139,7 +139,6 @@ static int sim_interrupt(wdparm_t arg)
|
|||||||
gpioinfo("Interrupt! callback=%p\n", simgpint->callback);
|
gpioinfo("Interrupt! callback=%p\n", simgpint->callback);
|
||||||
|
|
||||||
simgpint->callback(&simgpint->simgpio.gpio, simgpint->simgpio.id);
|
simgpint->callback(&simgpint->simgpio.gpio, simgpint->simgpio.id);
|
||||||
return OK;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int gpin_read(struct gpio_dev_s *dev, bool *value)
|
static int gpin_read(struct gpio_dev_s *dev, bool *value)
|
||||||
|
|||||||
+22
-22
@@ -2593,18 +2593,18 @@ static int calc_spot_position_regval(uint16_t val,
|
|||||||
static int set_spot_position(FAR isx019_dev_t *priv,
|
static int set_spot_position(FAR isx019_dev_t *priv,
|
||||||
imgsensor_value_t val)
|
imgsensor_value_t val)
|
||||||
{
|
{
|
||||||
uint8_t regval;
|
uint8_t regval = 0;
|
||||||
uint8_t reg_x;
|
uint8_t reg_x = 0;
|
||||||
uint8_t reg_y;
|
uint8_t reg_y = 0;
|
||||||
uint16_t w;
|
uint16_t w = 0;
|
||||||
uint16_t h;
|
uint16_t h = 0;
|
||||||
uint16_t clip_w;
|
uint16_t clip_w = 0;
|
||||||
uint16_t clip_h;
|
uint16_t clip_h = 0;
|
||||||
uint16_t offset_x;
|
uint16_t offset_x = 0;
|
||||||
uint16_t offset_y;
|
uint16_t offset_y = 0;
|
||||||
uint16_t x = (uint16_t)(val.value32 >> 16);
|
uint16_t x = (uint16_t)(val.value32 >> 16);
|
||||||
uint16_t y = (uint16_t)(val.value32 & 0xffff);
|
uint16_t y = (uint16_t)(val.value32 & 0xffff);
|
||||||
int split;
|
int split = 0;
|
||||||
|
|
||||||
/* Spot position of ISX019 is divided into 9x7 sections.
|
/* Spot position of ISX019 is divided into 9x7 sections.
|
||||||
* - Horizontal direction is divided into 9 sections.
|
* - Horizontal direction is divided into 9 sections.
|
||||||
@@ -3319,18 +3319,18 @@ static uint32_t restore_spot_position(uint16_t regval,
|
|||||||
static int get_spot_position(FAR isx019_dev_t *priv,
|
static int get_spot_position(FAR isx019_dev_t *priv,
|
||||||
FAR imgsensor_value_t *val)
|
FAR imgsensor_value_t *val)
|
||||||
{
|
{
|
||||||
uint8_t regval;
|
uint8_t regval = 0;
|
||||||
uint8_t regx;
|
uint8_t regx = 0;
|
||||||
uint8_t regy;
|
uint8_t regy = 0;
|
||||||
uint16_t w;
|
uint16_t w = 0;
|
||||||
uint16_t h;
|
uint16_t h = 0;
|
||||||
uint32_t x;
|
uint32_t x = 0;
|
||||||
uint32_t y;
|
uint32_t y = 0;
|
||||||
uint16_t clip_w;
|
uint16_t clip_w = 0;
|
||||||
uint16_t clip_h;
|
uint16_t clip_h = 0;
|
||||||
uint16_t offset_x;
|
uint16_t offset_x = 0;
|
||||||
uint16_t offset_y;
|
uint16_t offset_y = 0;
|
||||||
int split;
|
int split = 0;
|
||||||
|
|
||||||
isx019_i2c_read(priv, CAT_CATAE, SPOT_FRM_NUM, ®val, 1);
|
isx019_i2c_read(priv, CAT_CATAE, SPOT_FRM_NUM, ®val, 1);
|
||||||
|
|
||||||
|
|||||||
@@ -1286,7 +1286,8 @@ errout:
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#ifdef CONFIG_LPWAN_SX127X_RXSUPPORT
|
#if defined(CONFIG_LPWAN_SX127X_RXSUPPORT) && \
|
||||||
|
CONFIG_LPWAN_SX127X_RX_TIMEOUT > 0
|
||||||
static void sx127x_rx_watchdog(FAR void *arg)
|
static void sx127x_rx_watchdog(FAR void *arg)
|
||||||
{
|
{
|
||||||
FAR struct sx127x_dev_s *dev = (FAR struct sx127x_dev_s *)arg;
|
FAR struct sx127x_dev_s *dev = (FAR struct sx127x_dev_s *)arg;
|
||||||
@@ -1320,7 +1321,7 @@ static void sx127x_rx_watchdog(FAR void *arg)
|
|||||||
sx127x_rx_watchdog, dev,
|
sx127x_rx_watchdog, dev,
|
||||||
MSEC2TICK(dev->rx_timeout));
|
MSEC2TICK(dev->rx_timeout));
|
||||||
}
|
}
|
||||||
#endif
|
#endif /* CONFIG_LPWAN_SX127X_RXSUPPORT && CONFIG_LPWAN_SX127X_RX_TIMEOUT > 0 */
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Name: sx127x_lora_isr0_process
|
* Name: sx127x_lora_isr0_process
|
||||||
@@ -1519,6 +1520,7 @@ static int sx127x_fskook_isr0_process(FAR struct sx127x_dev_s *dev)
|
|||||||
{
|
{
|
||||||
/* Should we take care of RX timeout? */
|
/* Should we take care of RX timeout? */
|
||||||
|
|
||||||
|
#if CONFIG_LPWAN_SX127X_RX_TIMEOUT > 0
|
||||||
if (dev->rx_timeout > 0)
|
if (dev->rx_timeout > 0)
|
||||||
{
|
{
|
||||||
/* Keep a track of last RX time to detect timeout */
|
/* Keep a track of last RX time to detect timeout */
|
||||||
@@ -1531,6 +1533,7 @@ static int sx127x_fskook_isr0_process(FAR struct sx127x_dev_s *dev)
|
|||||||
sx127x_rx_watchdog, dev,
|
sx127x_rx_watchdog, dev,
|
||||||
MSEC2TICK(dev->rx_timeout));
|
MSEC2TICK(dev->rx_timeout));
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
if (dev->pfd)
|
if (dev->pfd)
|
||||||
{
|
{
|
||||||
@@ -4268,7 +4271,9 @@ static int sx127x_deinit(FAR struct sx127x_dev_s *dev)
|
|||||||
#ifdef CONFIG_LPWAN_SX127X_RXSUPPORT
|
#ifdef CONFIG_LPWAN_SX127X_RXSUPPORT
|
||||||
/* Cancel any running watchdog */
|
/* Cancel any running watchdog */
|
||||||
|
|
||||||
|
# if CONFIG_LPWAN_SX127X_RX_TIMEOUT > 0
|
||||||
work_cancel(LPWORK, &dev->rx_watchdog);
|
work_cancel(LPWORK, &dev->rx_watchdog);
|
||||||
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Enter SLEEP mode */
|
/* Enter SLEEP mode */
|
||||||
@@ -4626,7 +4631,9 @@ static int sx127x_unregister(FAR struct sx127x_dev_s *dev)
|
|||||||
nxsem_destroy(&dev->tx_sem);
|
nxsem_destroy(&dev->tx_sem);
|
||||||
#endif
|
#endif
|
||||||
#ifdef CONFIG_LPWAN_SX127X_RXSUPPORT
|
#ifdef CONFIG_LPWAN_SX127X_RXSUPPORT
|
||||||
|
# if CONFIG_LPWAN_SX127X_RX_TIMEOUT > 0
|
||||||
work_cancel(LPWORK, &dev->rx_watchdog);
|
work_cancel(LPWORK, &dev->rx_watchdog);
|
||||||
|
# endif
|
||||||
nxsem_destroy(&dev->rx_sem);
|
nxsem_destroy(&dev->rx_sem);
|
||||||
nxmutex_destroy(&dev->rx_buffer_lock);
|
nxmutex_destroy(&dev->rx_buffer_lock);
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -154,7 +154,7 @@ static inline void pkt_add_recvlen(FAR struct pkt_recvfrom_s *pstate,
|
|||||||
static void pkt_recvfrom_newdata(FAR struct net_driver_s *dev,
|
static void pkt_recvfrom_newdata(FAR struct net_driver_s *dev,
|
||||||
FAR struct pkt_recvfrom_s *pstate)
|
FAR struct pkt_recvfrom_s *pstate)
|
||||||
{
|
{
|
||||||
unsigned int offset = 0;
|
int offset = 0;
|
||||||
size_t recvlen;
|
size_t recvlen;
|
||||||
|
|
||||||
#ifdef CONFIG_NET_TIMESTAMP
|
#ifdef CONFIG_NET_TIMESTAMP
|
||||||
|
|||||||
Reference in New Issue
Block a user