Hi Vipul,

> > The point was to fix a broken API, not to do my own thing ;).
> > 
> > Looking at the history hal_gpio_toggle was correctly declared
> > initially and then changed with commit 274da3263 (no rational given
> > as to why).  
> 
> The change request was sent on the mailing list and there were no
> issues at the time from the community. If you take a look at
> hw/mcu/nordic/nrf52xxx/src/hal_gpio.c, hal_gpi_toggle() reads the
> gpio anyways because it needs to know the state of the gpio before it
> toggles it. This read anyways goes waste. If it is returned, it can
> be used by the calling code. If you want to use the read value, you
> can do so. If you do not want to use it. You can just ignore the
> return value.

I don't think that crappy implementations of an API are a justification to 
change the API, they should be a reason to change the implementation.

> > hal_gpio_toggle as it is adds no value to API and might as well be
> > dropped entirely.  
> 
> I do not agree.

I've stated my reasons why I think the current declaration is wrong and 
redundant - could you please explain why you think that's not the case?

Thanks,
Markus

Reply via email to