spark/core-common-lib — pull request #2 by mattande (2013-12-22 20:49:44+00:00)
Title: Add intensity control for RGB led

Please consider the following patch which adds intensity control for the RGB led. The default intensity is set at 1/4 off the peak power and can be modified by the user using either LED_SetIntensity() or RGB.intensity(). Values are set from 0 (off) to 255 (max). Intensity is taken into account for the LED_Fade / breathing LED.

To handle the color resolution during different levels of fade, the dynamic range of TIM1 has been increased 100x from 0-100 to 0-10000. The TIM1 interrupt remains at 100Hz.

These changes have been tested on hardware and look Ok to me. If you pull mattande/core-firmware:rgb_intensity (mattande/core-firmware@159ba033665d7e7a334949d8e6ad84f4d71fb121), application.cpp implements a short demo/test application which cycles through several user override color and fade at different intensity settings.

Note that changes in both core-firmware and core-common-lib are required for this change.