]> rtime.felk.cvut.cz Git - CanFestival-3.git/blobdiff - examples/TestMasterSlave/TestMaster.c
Bug on gen_cfile.py valueRangeTest generation fixed
[CanFestival-3.git] / examples / TestMasterSlave / TestMaster.c
index c4c11a2b66bf3a797168e86d48622f641cca5258..1f54340e174260b08ee79bd7bb5d507f5a309649 100644 (file)
@@ -24,9 +24,14 @@ INTEGER16 MasterMap13 = 0x0;         /* Mapped at index 0x200C, subindex 0x00 */
 /* Declaration of the value range types                                   */
 /**************************************************************************/
 
+#define valueRange_EMC 0x9F /* Type for index 0x1003 subindex 0x00 (only set of value 0 is possible) */
 UNS32 TestMaster_valueRangeTest (UNS8 typeValue, void * value)
 {
   switch (typeValue) {
+    case valueRange_EMC:
+      if (*(UNS8*)value < (UNS8)0) return OD_VALUE_TOO_LOW;
+      if (*(UNS8*)value > (UNS8)0) return OD_VALUE_TOO_HIGH;
+      break;
   }
   return 0;
 }
@@ -79,7 +84,7 @@ $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
                      };
                     subindex TestMaster_Index1003[] = 
                      {
-                       { RW, uint8, sizeof (UNS8), (void*)&TestMaster_highestSubIndex_obj1003 },
+                       { RW, valueRange_EMC, sizeof (UNS8), (void*)&TestMaster_highestSubIndex_obj1003 },
                        { RO, uint32, sizeof (UNS32), (void*)&TestMaster_obj1003[0] }
                      };