Skip to content

Commit

Permalink
fix compile error
Browse files Browse the repository at this point in the history
common/espressif/esp_pcnt.c: In function 'esp_pcnt_isr_default':
common/espressif/esp_pcnt.c:396:41: warning: passing argument 1 of 'spin_lock_irqsave' makes pointer from integer without a cast [-Wint-conversion]
  396 |           flags = spin_lock_irqsave(unit->lock);
      |                                     ~~~~^~~~~~
      |                                         |
      |                                         spinlock_t {aka unsigned char}
In file included from common/espressif/esp_pcnt.c:44:
/home/hujun5/下载/vela_sim/nuttx/include/nuttx/spinlock.h:507:55: note: expected 'volatile spinlock_t *' {aka 'volatile unsigned char *'} but argument is of type 'spinlock_t' {aka 'unsigned char'}
  507 | irqstate_t spin_lock_irqsave(FAR volatile spinlock_t *lock)
      |                                  ~~~~~~~~~~~~~~~~~~~~~^~~~

Signed-off-by: hujun5 <[email protected]>
  • Loading branch information
hujun260 committed Jan 15, 2025
1 parent 9b573f2 commit 6024ad6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions arch/risc-v/src/common/espressif/esp_pcnt.c
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ static int IRAM_ATTR esp_pcnt_isr_default(int irq, void *context,
int event_id = __builtin_ffs(event_status) - 1;
event_status &= (event_status - 1);

flags = spin_lock_irqsave(unit->lock);
flags = spin_lock_irqsave(&unit->lock);
if (unit->config.accum_count)
{
if (event_id == PCNT_LL_WATCH_EVENT_LOW_LIMIT)
Expand All @@ -406,7 +406,7 @@ static int IRAM_ATTR esp_pcnt_isr_default(int irq, void *context,
}
}

spin_unlock_irqrestore(&pcnt_units[unit_id].lock, flags);
spin_unlock_irqrestore(&unit->lock, flags);
if (unit->cb)
{
data.unit_id = unit_id;
Expand Down

0 comments on commit 6024ad6

Please sign in to comment.