elua/elua — pull request #39 by smartavionics (2014-02-02 11:30:27+00:00)
Title: Mb misc mods

Here's some fixes to the STM32 USB driver and the elua system timer.

The STM32 USB driver was consuming 100% CPU due to failing to clear the FIFO empty interrupt mask in
certain circumstances. This was triggered by connecting the USB to a host but not actually opening the
serial device on the host. This fix was found on the internet. Perhaps it would be a good idea to update the STM32 USB drivers to get the latest fixes.

The elua system timer was sometimes warping backwards in time when it wrapped. This happened because
it is possible (and not an error) for cmn_systimer_counter to exceed the value of PLATFORM_TIMER_SYS_MAX.

The value of PLATFORM_TIMER_SYS_MAX for lua long builds was half of what it should be.