Skip to content

Commit 5354850

Browse files
hujun260anchao
authored andcommitted
fix build error
common/espressif/esp_rmt.c: In function 'rmt_set_tx_thr_intr_en': common/espressif/esp_rmt.c:654:48: error: passing argument 1 of 'spin_lock_irqsave' makes pointer from integer without a cast [-Werror=int-conversion] 654 | flags = spin_lock_irqsave(g_rmtdev_common.rmt_spinlock); | ~~~~~~~~~~~~~~~^~~~~~~~~~~~~ | | | spinlock_t {aka unsigned char} /home/hujun5/downloads1/vela_sim/nuttx/include/nuttx/spinlock.h:617:55: note: expected 'volatile spinlock_t *' {aka 'volatile unsigned char *'} but argument is of type 'spinlock_t' {aka 'unsigned char'} 617 | irqstate_t spin_lock_irqsave(FAR volatile spinlock_t *lock) | ~~~~~~~~~~~~~~~~~~~~~^~~~ CC: nsh_script.c common/espressif/esp_rmt.c:662:48: error: passing argument 1 of 'spin_lock_irqsave' makes pointer from integer without a cast [-Werror=int-conversion] 662 | flags = spin_lock_irqsave(g_rmtdev_common.rmt_spinlock); | ~~~~~~~~~~~~~~~^~~~~~~~~~~~~ | | | spinlock_t {aka unsigned char} /home/hujun5/downloads1/vela_sim/nuttx/include/nuttx/spinlock.h:617:55: note: expected ' Signed-off-by: hujun5 <[email protected]>
1 parent 92b9a30 commit 5354850

File tree

2 files changed

+22
-22
lines changed

2 files changed

+22
-22
lines changed

arch/risc-v/src/common/espressif/esp_rmt.c

+11-11
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,7 @@ static void rmt_module_enable(void)
403403
{
404404
irqstate_t flags;
405405

406-
flags = spin_lock_irqsave(g_rmtdev_common.rmt_spinlock);
406+
flags = spin_lock_irqsave(&g_rmtdev_common.rmt_spinlock);
407407

408408
if (g_rmtdev_common.rmt_module_enabled == false)
409409
{
@@ -454,7 +454,7 @@ static int rmt_set_rx_thr_intr_en(rmt_channel_t channel, bool en,
454454
return -EINVAL;
455455
}
456456

457-
flags = spin_lock_irqsave(g_rmtdev_common.rmt_spinlock);
457+
flags = spin_lock_irqsave(&g_rmtdev_common.rmt_spinlock);
458458
rmt_ll_rx_set_limit(g_rmtdev_common.hal.regs,
459459
RMT_DECODE_RX_CHANNEL(channel), evt_thresh);
460460
mask = RMT_LL_EVENT_RX_THRES(RMT_DECODE_RX_CHANNEL(channel));
@@ -463,7 +463,7 @@ static int rmt_set_rx_thr_intr_en(rmt_channel_t channel, bool en,
463463
}
464464
else
465465
{
466-
flags = spin_lock_irqsave(g_rmtdev_common.rmt_spinlock);
466+
flags = spin_lock_irqsave(&g_rmtdev_common.rmt_spinlock);
467467
mask = RMT_LL_EVENT_RX_THRES(RMT_DECODE_RX_CHANNEL(channel));
468468
rmt_ll_enable_interrupt(g_rmtdev_common.hal.regs, mask, false);
469469
spin_unlock_irqrestore(&g_rmtdev_common.rmt_spinlock, flags);
@@ -504,7 +504,7 @@ static int rmt_rx_start(rmt_channel_t channel, bool rx_idx_rst)
504504

505505
DEBUGASSERT(RMT_IS_RX_CHANNEL(channel));
506506

507-
flags = spin_lock_irqsave(g_rmtdev_common.rmt_spinlock);
507+
flags = spin_lock_irqsave(&g_rmtdev_common.rmt_spinlock);
508508

509509
rmt_ll_rx_enable(g_rmtdev_common.hal.regs, ch, false);
510510
if (rx_idx_rst)
@@ -551,7 +551,7 @@ static int rmt_tx_start(rmt_channel_t channel, bool tx_idx_rst)
551551

552552
DEBUGASSERT(RMT_IS_TX_CHANNEL(channel));
553553

554-
flags = spin_lock_irqsave(g_rmtdev_common.rmt_spinlock);
554+
flags = spin_lock_irqsave(&g_rmtdev_common.rmt_spinlock);
555555
if (tx_idx_rst)
556556
{
557557
rmt_ll_tx_reset_pointer(g_rmtdev_common.hal.regs, channel);
@@ -609,7 +609,7 @@ static int rmt_set_tx_loop_mode(rmt_channel_t channel, bool loop_en)
609609

610610
DEBUGASSERT(RMT_IS_TX_CHANNEL(channel));
611611

612-
flags = spin_lock_irqsave(g_rmtdev_common.rmt_spinlock);
612+
flags = spin_lock_irqsave(&g_rmtdev_common.rmt_spinlock);
613613
rmt_ll_tx_enable_loop(g_rmtdev_common.hal.regs, channel, loop_en);
614614
spin_unlock_irqrestore(&g_rmtdev_common.rmt_spinlock, flags);
615615

@@ -651,15 +651,15 @@ static int rmt_set_tx_thr_intr_en(rmt_channel_t channel, bool en,
651651

652652
DEBUGASSERT(evt_thresh <= item_block_len);
653653

654-
flags = spin_lock_irqsave(g_rmtdev_common.rmt_spinlock);
654+
flags = spin_lock_irqsave(&g_rmtdev_common.rmt_spinlock);
655655
rmt_ll_tx_set_limit(g_rmtdev_common.hal.regs, channel, evt_thresh);
656656
rmt_ll_enable_interrupt(g_rmtdev_common.hal.regs,
657657
RMT_LL_EVENT_TX_THRES(channel), true);
658658
spin_unlock_irqrestore(&g_rmtdev_common.rmt_spinlock, flags);
659659
}
660660
else
661661
{
662-
flags = spin_lock_irqsave(g_rmtdev_common.rmt_spinlock);
662+
flags = spin_lock_irqsave(&g_rmtdev_common.rmt_spinlock);
663663
rmt_ll_enable_interrupt(g_rmtdev_common.hal.regs,
664664
RMT_LL_EVENT_TX_THRES(channel), false);
665665
spin_unlock_irqrestore(&g_rmtdev_common.rmt_spinlock, flags);
@@ -801,7 +801,7 @@ static int rmt_internal_config(rmt_dev_t *dev,
801801
return -EINVAL;
802802
}
803803

804-
flags = spin_lock_irqsave(g_rmtdev_common.rmt_spinlock);
804+
flags = spin_lock_irqsave(&g_rmtdev_common.rmt_spinlock);
805805

806806
rmt_ll_enable_mem_access_nonfifo(dev, true);
807807

@@ -866,7 +866,7 @@ static int rmt_internal_config(rmt_dev_t *dev,
866866
uint8_t carrier_level = rmt_param->tx_config.carrier_level;
867867
uint8_t idle_level = rmt_param->tx_config.idle_level;
868868

869-
flags = spin_lock_irqsave(g_rmtdev_common.rmt_spinlock);
869+
flags = spin_lock_irqsave(&g_rmtdev_common.rmt_spinlock);
870870
rmt_ll_tx_set_channel_clock_div(dev, channel, clk_div);
871871
rmt_ll_tx_set_mem_blocks(dev, channel, mem_cnt);
872872
rmt_ll_tx_reset_pointer(dev, channel);
@@ -918,7 +918,7 @@ static int rmt_internal_config(rmt_dev_t *dev,
918918
uint8_t filter_cnt = rmt_param->rx_config.filter_ticks_thresh;
919919
uint16_t threshold = rmt_param->rx_config.idle_threshold;
920920

921-
flags = spin_lock_irqsave(g_rmtdev_common.rmt_spinlock);
921+
flags = spin_lock_irqsave(&g_rmtdev_common.rmt_spinlock);
922922
rmt_ll_rx_set_channel_clock_div(dev, RMT_DECODE_RX_CHANNEL(channel),
923923
clk_div);
924924
rmt_ll_rx_set_mem_blocks(dev, RMT_DECODE_RX_CHANNEL(channel), mem_cnt);

arch/xtensa/src/common/espressif/esp_rmt.c

+11-11
Original file line numberDiff line numberDiff line change
@@ -449,7 +449,7 @@ static void rmt_module_enable(void)
449449
{
450450
irqstate_t flags;
451451

452-
flags = spin_lock_irqsave(g_rmtdev_common.rmt_spinlock);
452+
flags = spin_lock_irqsave(&g_rmtdev_common.rmt_spinlock);
453453

454454
if (g_rmtdev_common.rmt_module_enabled == false)
455455
{
@@ -501,7 +501,7 @@ static int rmt_set_rx_thr_intr_en(rmt_channel_t channel, bool en,
501501
return -EINVAL;
502502
}
503503

504-
flags = spin_lock_irqsave(g_rmtdev_common.rmt_spinlock);
504+
flags = spin_lock_irqsave(&g_rmtdev_common.rmt_spinlock);
505505
rmt_ll_rx_set_limit(g_rmtdev_common.hal.regs,
506506
RMT_DECODE_RX_CHANNEL(channel), evt_thresh);
507507
mask = RMT_LL_EVENT_RX_THRES(RMT_DECODE_RX_CHANNEL(channel));
@@ -510,7 +510,7 @@ static int rmt_set_rx_thr_intr_en(rmt_channel_t channel, bool en,
510510
}
511511
else
512512
{
513-
flags = spin_lock_irqsave(g_rmtdev_common.rmt_spinlock);
513+
flags = spin_lock_irqsave(&g_rmtdev_common.rmt_spinlock);
514514
mask = RMT_LL_EVENT_RX_THRES(RMT_DECODE_RX_CHANNEL(channel));
515515
rmt_ll_enable_interrupt(g_rmtdev_common.hal.regs, mask, false);
516516
spin_unlock_irqrestore(&g_rmtdev_common.rmt_spinlock, flags);
@@ -551,7 +551,7 @@ static int rmt_rx_start(rmt_channel_t channel, bool rx_idx_rst)
551551

552552
DEBUGASSERT(RMT_IS_RX_CHANNEL(channel));
553553

554-
flags = spin_lock_irqsave(g_rmtdev_common.rmt_spinlock);
554+
flags = spin_lock_irqsave(&g_rmtdev_common.rmt_spinlock);
555555

556556
rmt_ll_rx_enable(g_rmtdev_common.hal.regs, ch, false);
557557
if (rx_idx_rst)
@@ -598,7 +598,7 @@ static int rmt_tx_start(rmt_channel_t channel, bool tx_idx_rst)
598598

599599
DEBUGASSERT(RMT_IS_TX_CHANNEL(channel));
600600

601-
flags = spin_lock_irqsave(g_rmtdev_common.rmt_spinlock);
601+
flags = spin_lock_irqsave(&g_rmtdev_common.rmt_spinlock);
602602
if (tx_idx_rst)
603603
{
604604
rmt_ll_tx_reset_pointer(g_rmtdev_common.hal.regs, channel);
@@ -656,7 +656,7 @@ static int rmt_set_tx_loop_mode(rmt_channel_t channel, bool loop_en)
656656

657657
DEBUGASSERT(RMT_IS_TX_CHANNEL(channel));
658658

659-
flags = spin_lock_irqsave(g_rmtdev_common.rmt_spinlock);
659+
flags = spin_lock_irqsave(&g_rmtdev_common.rmt_spinlock);
660660
rmt_ll_tx_enable_loop(g_rmtdev_common.hal.regs, channel, loop_en);
661661
spin_unlock_irqrestore(&g_rmtdev_common.rmt_spinlock, flags);
662662

@@ -698,15 +698,15 @@ static int rmt_set_tx_thr_intr_en(rmt_channel_t channel, bool en,
698698

699699
DEBUGASSERT(evt_thresh <= item_block_len);
700700

701-
flags = spin_lock_irqsave(g_rmtdev_common.rmt_spinlock);
701+
flags = spin_lock_irqsave(&g_rmtdev_common.rmt_spinlock);
702702
rmt_ll_tx_set_limit(g_rmtdev_common.hal.regs, channel, evt_thresh);
703703
rmt_ll_enable_interrupt(g_rmtdev_common.hal.regs,
704704
RMT_LL_EVENT_TX_THRES(channel), true);
705705
spin_unlock_irqrestore(&g_rmtdev_common.rmt_spinlock, flags);
706706
}
707707
else
708708
{
709-
flags = spin_lock_irqsave(g_rmtdev_common.rmt_spinlock);
709+
flags = spin_lock_irqsave(&g_rmtdev_common.rmt_spinlock);
710710
rmt_ll_enable_interrupt(g_rmtdev_common.hal.regs,
711711
RMT_LL_EVENT_TX_THRES(channel), false);
712712
spin_unlock_irqrestore(&g_rmtdev_common.rmt_spinlock, flags);
@@ -848,7 +848,7 @@ static int rmt_internal_config(rmt_dev_t *dev,
848848
return -EINVAL;
849849
}
850850

851-
flags = spin_lock_irqsave(g_rmtdev_common.rmt_spinlock);
851+
flags = spin_lock_irqsave(&g_rmtdev_common.rmt_spinlock);
852852

853853
rmt_ll_enable_mem_access_nonfifo(dev, true);
854854

@@ -913,7 +913,7 @@ static int rmt_internal_config(rmt_dev_t *dev,
913913
uint8_t carrier_level = rmt_param->tx_config.carrier_level;
914914
uint8_t idle_level = rmt_param->tx_config.idle_level;
915915

916-
flags = spin_lock_irqsave(g_rmtdev_common.rmt_spinlock);
916+
flags = spin_lock_irqsave(&g_rmtdev_common.rmt_spinlock);
917917
rmt_ll_tx_set_channel_clock_div(dev, channel, clk_div);
918918
rmt_ll_tx_set_mem_blocks(dev, channel, mem_cnt);
919919
rmt_ll_tx_reset_pointer(dev, channel);
@@ -965,7 +965,7 @@ static int rmt_internal_config(rmt_dev_t *dev,
965965
uint8_t filter_cnt = rmt_param->rx_config.filter_ticks_thresh;
966966
uint16_t threshold = rmt_param->rx_config.idle_threshold;
967967

968-
flags = spin_lock_irqsave(g_rmtdev_common.rmt_spinlock);
968+
flags = spin_lock_irqsave(&g_rmtdev_common.rmt_spinlock);
969969
rmt_ll_rx_set_channel_clock_div(dev, RMT_DECODE_RX_CHANNEL(channel),
970970
clk_div);
971971
rmt_ll_rx_set_mem_blocks(dev, RMT_DECODE_RX_CHANNEL(channel), mem_cnt);

0 commit comments

Comments
 (0)