Skip to content

Commit

Permalink
io_timer_init.h: avoid using timer_channel, as imxrt does not have it
Browse files Browse the repository at this point in the history
  • Loading branch information
bkueng authored and davids5 committed Feb 13, 2020
1 parent ef36d70 commit 6b1ee7b
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ static inline constexpr io_timers_channel_mapping_t initIOTimerChannelMapping(co
uint32_t channel_count = 0;

for (uint32_t channel = 0; channel < MAX_TIMER_IO_CHANNELS; ++channel) {
if (timer_io_channels_conf[channel].timer_channel == 0) {
if (timer_io_channels_conf[channel].gpio_in == 0 && timer_io_channels_conf[channel].gpio_out == 0) {
break;
}

Expand All @@ -88,7 +88,8 @@ static inline constexpr io_timers_channel_mapping_t initIOTimerChannelMapping(co
// validate that the number of configured channels matches DIRECT_PWM_OUTPUT_CHANNELS
uint32_t num_channels = 0;

while (num_channels < MAX_TIMER_IO_CHANNELS && timer_io_channels_conf[num_channels].timer_channel != 0) {
while (num_channels < MAX_TIMER_IO_CHANNELS &&
(timer_io_channels_conf[num_channels].gpio_in != 0 || timer_io_channels_conf[num_channels].gpio_out != 0)) {
++num_channels;
}

Expand Down

0 comments on commit 6b1ee7b

Please sign in to comment.