Creates DAC interface

Fork of DevInterfaces by wimbeaumont Project

Revision:
0:da1fb7dd363f
Child:
1:5672673314f9
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/getVersion.cpp	Fri Oct 23 19:34:53 2015 +0000
@@ -0,0 +1,59 @@
+#include "getVersion.h"
+
+#define GETVERSION_SRC_VER  "0.10"
+
+#include "mbed.h"
+
+#define NULL 0
+
+void getVersion::get_dec_version( unsigned short  hexversion , unsigned char & version, unsigned char& subversion) {
+        subversion =(unsigned short)(  hexversion & 0xFF);
+        hexversion=hexversion >> 8; 
+        version =(unsigned char)(  hexversion & 0xFF);
+    }
+
+
+
+unsigned short  getVersion::get_hex_version_nr(const char * vers){    
+    float verf = strtof(vers,NULL);
+    unsigned short version=(unsigned short) verf;
+    verf=verf-version;
+    version = version<<8;
+    verf=verf*100;
+    unsigned char  sub=(unsigned char)verf;
+    version=version| sub;
+    return version;
+}   
+
+
+
+
+
+
+unsigned short getVersion::getHdrVersion(){ 
+    if( hver == NULL) return  get_hex_version_nr(GETVERSION_HDR_VER);
+    else return get_hex_version_nr(hver);
+    }
+
+    unsigned short getVersion::getSrcVersion(){
+          if( sver == NULL) return  get_hex_version_nr(GETVERSION_SRC_VER);
+    else return get_hex_version_nr(sver);
+ }
+
+
+unsigned short getVersion::getCompileTime(){
+    if ( ctime == NULL ) return 0;
+    else return 0;
+}
+    
+
+unsigned short getVersion::getCompileDate(){
+    if ( cdate == NULL ) return 0;
+    else return 0;
+}
+
+unsigned short getVersion::getCompileYear(){
+    
+    if ( cdate == NULL ) return 0;
+    else return 0;
+}
\ No newline at end of file