Solution for Bluetooth SIG hands-on training course

Dependencies:   BLE_API mbed-dev-bin nRF51822-bluetooth-mdw

Dependents:   microbit

Fork of microbit-dal-bluetooth-mdw_starter by Martin Woolley

Revision:
21:cab56b701601
Parent:
20:ad2a5c7debf4
Child:
22:23d7b9a4b082
diff -r ad2a5c7debf4 -r cab56b701601 source/drivers/MicroBitDisplay.cpp
--- a/source/drivers/MicroBitDisplay.cpp	Wed Jul 13 12:17:51 2016 +0100
+++ b/source/drivers/MicroBitDisplay.cpp	Wed Jul 13 12:17:53 2016 +0100
@@ -287,7 +287,7 @@
         if (animationMode == ANIMATION_MODE_SCROLL_IMAGE)
             this->updateScrollImage();
 
-        if (animationMode == ANIMATION_MODE_ANIMATE_IMAGE || animationMode == ANIMATION_MODE_ANIMATE_IMAGE_WITH_CLEAR)
+        if (animationMode == ANIMATION_MODE_ANIMATE_IMAGE)
             this->updateAnimateImage();
 
         if(animationMode == ANIMATION_MODE_PRINT_CHARACTER)
@@ -384,11 +384,8 @@
     //wait until we have rendered the last position to give a continuous animation.
     if (scrollingImagePosition <= -scrollingImage.getWidth() + (MICROBIT_DISPLAY_WIDTH + scrollingImageStride) && scrollingImageRendered)
     {
-        if (animationMode == ANIMATION_MODE_ANIMATE_IMAGE_WITH_CLEAR)
-            this->clear();
-
         animationMode = ANIMATION_MODE_NONE;
-
+        this->clear();
         this->sendAnimationCompleteEvent();
         return;
     }
@@ -894,8 +891,6 @@
   * @param startingPosition the starting position on the display for the animation
   *                         to begin at. Defaults to MICROBIT_DISPLAY_ANIMATE_DEFAULT_POS.
   *
-  * @param autoClear defines whether or not the display is automatically cleared once the animation is complete. By default, the display is cleared. Set this parameter to zero to disable the autoClear operation.
-  *
   * @return MICROBIT_OK, MICROBIT_BUSY if the screen is in use, or MICROBIT_INVALID_PARAMETER.
   *
   * @code
@@ -907,7 +902,7 @@
   * display.animateAsync(i,100,5);
   * @endcode
   */
-int MicroBitDisplay::animateAsync(MicroBitImage image, int delay, int stride, int startingPosition, int autoClear)
+int MicroBitDisplay::animateAsync(MicroBitImage image, int delay, int stride, int startingPosition)
 {
     //sanitise the delay value
     if(delay <= 0)
@@ -927,7 +922,7 @@
 
         animationDelay = stride == 0 ? 0 : delay;
         animationTick = delay-1;
-        animationMode = autoClear ? ANIMATION_MODE_ANIMATE_IMAGE_WITH_CLEAR : ANIMATION_MODE_ANIMATE_IMAGE;
+        animationMode = ANIMATION_MODE_ANIMATE_IMAGE;
     }
     else
     {
@@ -949,8 +944,6 @@
   * @param startingPosition the starting position on the display for the animation
   *                         to begin at. Defaults to MICROBIT_DISPLAY_ANIMATE_DEFAULT_POS.
   *
-  * @param autoClear defines whether or not the display is automatically cleared once the animation is complete. By default, the display is cleared. Set this parameter to zero to disable the autoClear operation.
-  *
   * @return MICROBIT_OK, MICROBIT_CANCELLED or MICROBIT_INVALID_PARAMETER.
   *
   * @code
@@ -962,7 +955,7 @@
   * display.animate(i,100,5);
   * @endcode
   */
-int MicroBitDisplay::animate(MicroBitImage image, int delay, int stride, int startingPosition, int autoClear)
+int MicroBitDisplay::animate(MicroBitImage image, int delay, int stride, int startingPosition)
 {
     //sanitise the delay value
     if(delay <= 0)
@@ -976,7 +969,7 @@
     if (animationMode == ANIMATION_MODE_NONE)
     {
         // Start the effect.
-        this->animateAsync(image, delay, stride, startingPosition, autoClear);
+        this->animateAsync(image, delay, stride, startingPosition);
 
         // Wait for completion.
         //TODO: Put this in when we merge tight-validation