1Mbit EEPROMを便利に使うためのライブラリ

Dependents:   EEPROM_Reset_Program EEPROM_Encode_Program

Revision:
3:d040fa9b5bb9
Parent:
1:66c2c82f4b34
--- a/EEPROM_lib.cpp	Mon Feb 11 16:59:46 2019 +0000
+++ b/EEPROM_lib.cpp	Tue Feb 12 15:44:54 2019 +0000
@@ -127,10 +127,10 @@
 int EEPROM_lib::chargeBuff(int DATA){
     if(buff_ptr < 128 - 3){
         EEPROM_cast.i = DATA;
-        cmd[buff_ptr + 2] = EEPROM_cast.cast[3];
-        cmd[buff_ptr + 3] = EEPROM_cast.cast[2];
-        cmd[buff_ptr + 4] = EEPROM_cast.cast[1];
-        cmd[buff_ptr + 5] = EEPROM_cast.cast[0];
+        cmd[buff_ptr + 2] = EEPROM_cast.cast[0];
+        cmd[buff_ptr + 3] = EEPROM_cast.cast[1];
+        cmd[buff_ptr + 4] = EEPROM_cast.cast[2];
+        cmd[buff_ptr + 5] = EEPROM_cast.cast[3];
         
         buff_ptr += 4;
     }
@@ -140,8 +140,8 @@
 int EEPROM_lib::chargeBuff(short DATA){
     if(buff_ptr < 128 - 1){
         EEPROM_cast.s = DATA;
-        cmd[buff_ptr + 2] = EEPROM_cast.cast[1];
-        cmd[buff_ptr + 3] = EEPROM_cast.cast[0];
+        cmd[buff_ptr + 2] = EEPROM_cast.cast[0];
+        cmd[buff_ptr + 3] = EEPROM_cast.cast[1];
         
         buff_ptr += 2;
     }
@@ -151,14 +151,14 @@
 int EEPROM_lib::chargeBuff(long long DATA){
     if(buff_ptr < 128 - 7){
         EEPROM_cast.ll = DATA;
-        cmd[buff_ptr + 2] = EEPROM_cast.cast[7];
-        cmd[buff_ptr + 3] = EEPROM_cast.cast[6];
-        cmd[buff_ptr + 4] = EEPROM_cast.cast[5];
-        cmd[buff_ptr + 5] = EEPROM_cast.cast[4];
-        cmd[buff_ptr + 6] = EEPROM_cast.cast[3];
-        cmd[buff_ptr + 7] = EEPROM_cast.cast[2];
-        cmd[buff_ptr + 8] = EEPROM_cast.cast[1];
-        cmd[buff_ptr + 9] = EEPROM_cast.cast[0];
+        cmd[buff_ptr + 2] = EEPROM_cast.cast[0];
+        cmd[buff_ptr + 3] = EEPROM_cast.cast[1];
+        cmd[buff_ptr + 4] = EEPROM_cast.cast[2];
+        cmd[buff_ptr + 5] = EEPROM_cast.cast[3];
+        cmd[buff_ptr + 6] = EEPROM_cast.cast[4];
+        cmd[buff_ptr + 7] = EEPROM_cast.cast[5];
+        cmd[buff_ptr + 8] = EEPROM_cast.cast[6];
+        cmd[buff_ptr + 9] = EEPROM_cast.cast[7];
         
         buff_ptr += 8;
     }
@@ -168,10 +168,10 @@
 int EEPROM_lib::chargeBuff(float DATA){
     if(buff_ptr < 128 - 3){
         EEPROM_cast.f = DATA;
-        cmd[buff_ptr + 2] = EEPROM_cast.cast[3];
-        cmd[buff_ptr + 3] = EEPROM_cast.cast[2];
-        cmd[buff_ptr + 4] = EEPROM_cast.cast[1];
-        cmd[buff_ptr + 5] = EEPROM_cast.cast[0];
+        cmd[buff_ptr + 2] = EEPROM_cast.cast[0];
+        cmd[buff_ptr + 3] = EEPROM_cast.cast[1];
+        cmd[buff_ptr + 4] = EEPROM_cast.cast[2];
+        cmd[buff_ptr + 5] = EEPROM_cast.cast[3];
         
         buff_ptr += 4;
     }
@@ -181,14 +181,14 @@
 int EEPROM_lib::chargeBuff(double DATA){
     if(buff_ptr < 128 - 7){
         EEPROM_cast.d = DATA;
-        cmd[buff_ptr + 2] = EEPROM_cast.cast[7];
-        cmd[buff_ptr + 3] = EEPROM_cast.cast[6];
-        cmd[buff_ptr + 4] = EEPROM_cast.cast[5];
-        cmd[buff_ptr + 5] = EEPROM_cast.cast[4];
-        cmd[buff_ptr + 6] = EEPROM_cast.cast[3];
-        cmd[buff_ptr + 7] = EEPROM_cast.cast[2];
-        cmd[buff_ptr + 8] = EEPROM_cast.cast[1];
-        cmd[buff_ptr + 9] = EEPROM_cast.cast[0];
+        cmd[buff_ptr + 2] = EEPROM_cast.cast[0];
+        cmd[buff_ptr + 3] = EEPROM_cast.cast[1];
+        cmd[buff_ptr + 4] = EEPROM_cast.cast[2];
+        cmd[buff_ptr + 5] = EEPROM_cast.cast[3];
+        cmd[buff_ptr + 6] = EEPROM_cast.cast[4];
+        cmd[buff_ptr + 7] = EEPROM_cast.cast[5];
+        cmd[buff_ptr + 8] = EEPROM_cast.cast[6];
+        cmd[buff_ptr + 9] = EEPROM_cast.cast[7];
         
         buff_ptr += 8;
     }