LCD LIB

Dependents:   HagridOS5

Fork of RA8875 by David Smart

Files at this revision

API Documentation at this revision

Comitter:
WiredHome
Date:
Thu Dec 08 12:29:54 2016 +0000
Parent:
136:224e03d5c31f
Child:
140:33ca352755a2
Commit message:
Correct a defect in BlockMove

Changed in this revision

RA8875.cpp Show annotated file Show diff for this revision Revisions of this file
RA8875.h Show annotated file Show diff for this revision Revisions of this file
--- a/RA8875.cpp	Wed Nov 16 02:48:45 2016 +0000
+++ b/RA8875.cpp	Thu Dec 08 12:29:54 2016 +0000
@@ -1739,20 +1739,21 @@
 
 RetCode_t RA8875::BlockMove(uint8_t dstLayer, uint8_t dstDataSelect, point_t dstPoint,
     uint8_t srcLayer, uint8_t srcDataSelect, point_t srcPoint,
-    uint16_t bte_width, uint16_t bte_height,
+    dim_t bte_width, dim_t bte_height,
     uint8_t bte_op_code, uint8_t bte_rop_code)
 {
     uint8_t cmd;
 
     PERFORMANCE_RESET;
+    ///@todo range check and error return rather than to secretly fix
     srcPoint.x &= 0x3FF;    // prevent high bits from doing unexpected things
     srcPoint.y &= 0x1FF;
     dstPoint.x &= 0x3FF;
     dstPoint.y &= 0x1FF;
     WriteCommandW(0x54, srcPoint.x);
-    WriteCommandW(0x56, ((srcLayer & 1) << 7) | srcPoint.y);
+    WriteCommandW(0x56, ((dim_t)(srcLayer & 1) << 15) | srcPoint.y);
     WriteCommandW(0x58, dstPoint.x);
-    WriteCommandW(0x5A, ((dstLayer & 1) << 7) | dstPoint.y);
+    WriteCommandW(0x5A, ((dim_t)(dstLayer & 1) << 15) | dstPoint.y);
     WriteCommandW(0x5C, bte_width);
     WriteCommandW(0x5E, bte_height);
     WriteCommand(0x51,  ((bte_rop_code & 0x0F) << 4) | (bte_op_code & 0x0F));
--- a/RA8875.h	Wed Nov 16 02:48:45 2016 +0000
+++ b/RA8875.h	Thu Dec 08 12:29:54 2016 +0000
@@ -2266,10 +2266,10 @@
     /// foreground and background color registers, and others. Those must be set
     /// outside of this API.
     ///
-    /// @param[in] dstLayer layer [5B.7]. layer value is 0 or 1 repreenting layer 1 and 2.
+    /// @param[in] dstLayer layer [5B.7]. layer value is 0 or 1 representing layer 1 and 2.
     /// @param[in] dstDataSelect [50.5] defines the destination data type 0: block, 1: linear.
     /// @param[in] dstPoint [58-5B] is a point_t defining the destination coordinate.
-    /// @param[in] srcLayer layer [57.7]. layer value is 0 or 1 repreenting layer 1 and 2.
+    /// @param[in] srcLayer layer [57.7]. layer value is 0 or 1 representing layer 1 and 2.
     /// @param[in] srcDataSelect [50.6] defines the source data type 0: block, 1: linear.
     /// @param[in] srcPoint [54-57] is a point_t defining the source coordinate.
     /// @param[in] bte_width [5C-5D]. operation width.
@@ -2282,7 +2282,7 @@
     ///
     RetCode_t BlockMove(uint8_t dstLayer, uint8_t dstDataSelect, point_t dstPoint,
         uint8_t srcLayer, uint8_t srcDataSelect, point_t srcPoint,
-        uint16_t bte_width, uint16_t bte_height,
+        dim_t bte_width, dim_t bte_height,
         uint8_t bte_op_code, uint8_t bte_rop_code);