thats actually not the point.  Srsly, you shouldn't ever need to null check
get_usart(), you should just give it valid values.

It's setup in such a way that if you dont, it should fail soon and visibly.

This is a problem with the existing I2C/SPI, because they'll still
configure a valid port if you give them a bogus value.


On Tue, Jun 4, 2013 at 8:31 PM, Michael Pratt <notifications@github.com>wrote:

> In chip/stm32f40x/dev/hw/usart.c:
>
> > @@ -41,6 +41,8 @@
> >  uint8_t usart_ready = 0;
> >
> >  void init_usart(void) {
> > +    usart_t *usart1 = get_usart(1);
>
> Since this can return NULL, it would be great to do a check here. There
> isn't much that can be done, but at least we can return and prevent a fault.
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/prattmic/F4OS/pull/13/files#r4538330>
> .
>