drivers/counter native_sim: Avoid reusing tag name
Don't use the same name for the structure instance and type. As that is a violation of MISRA-C 2012 rule 5.7. Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
This commit is contained in:
parent
919de4ec5f
commit
fe70e480f4
1 changed files with 4 additions and 4 deletions
|
@ -32,7 +32,7 @@ static struct counter_alarm_cfg pending_alarm[DRIVER_CONFIG_INFO_CHANNELS];
|
|||
static bool is_alarm_pending[DRIVER_CONFIG_INFO_CHANNELS];
|
||||
static struct counter_top_cfg top;
|
||||
static bool is_top_set;
|
||||
static const struct device *device;
|
||||
static const struct device *dev_p;
|
||||
|
||||
static void schedule_next_isr(void)
|
||||
{
|
||||
|
@ -67,7 +67,7 @@ static void counter_isr(const void *arg)
|
|||
if (is_alarm_pending[i] && (current_value == pending_alarm[i].ticks)) {
|
||||
is_alarm_pending[i] = false;
|
||||
if (pending_alarm[i].callback) {
|
||||
pending_alarm[i].callback(device, i, current_value,
|
||||
pending_alarm[i].callback(dev_p, i, current_value,
|
||||
pending_alarm[i].user_data);
|
||||
}
|
||||
}
|
||||
|
@ -75,7 +75,7 @@ static void counter_isr(const void *arg)
|
|||
|
||||
if (is_top_set && (current_value == top.ticks)) {
|
||||
if (top.callback) {
|
||||
top.callback(device, top.user_data);
|
||||
top.callback(dev_p, top.user_data);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -84,7 +84,7 @@ static void counter_isr(const void *arg)
|
|||
|
||||
static int ctr_init(const struct device *dev)
|
||||
{
|
||||
device = dev;
|
||||
dev_p = dev;
|
||||
memset(is_alarm_pending, 0, sizeof(is_alarm_pending));
|
||||
is_top_set = false;
|
||||
top.ticks = TOP_VALUE;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue