Driver for HP20X sensor
Dependents: 8-0_OneNet_IoT_demo
driver_mbed_HP20x.cpp@0:2ee0bc82e7b8, 2017-03-29 (annotated)
- Committer:
- TaylorGy
- Date:
- Wed Mar 29 03:09:38 2017 +0000
- Revision:
- 0:2ee0bc82e7b8
driver for HP20x sensor
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
TaylorGy | 0:2ee0bc82e7b8 | 1 | /* |
TaylorGy | 0:2ee0bc82e7b8 | 2 | * File name : HP20x_dev.cpp |
TaylorGy | 0:2ee0bc82e7b8 | 3 | * Description: Driver for I2C PRECISION BAROMETER AND ALTIMETER [HP206C] |
TaylorGy | 0:2ee0bc82e7b8 | 4 | * Author : Oliver Wang from Seeed studio |
TaylorGy | 0:2ee0bc82e7b8 | 5 | * Version : V0.1 |
TaylorGy | 0:2ee0bc82e7b8 | 6 | * Create Time: 2014/04 |
TaylorGy | 0:2ee0bc82e7b8 | 7 | * Change Log : |
TaylorGy | 0:2ee0bc82e7b8 | 8 | */ |
TaylorGy | 0:2ee0bc82e7b8 | 9 | |
TaylorGy | 0:2ee0bc82e7b8 | 10 | /****************************************************************************/ |
TaylorGy | 0:2ee0bc82e7b8 | 11 | /*** Include files ***/ |
TaylorGy | 0:2ee0bc82e7b8 | 12 | /****************************************************************************/ |
TaylorGy | 0:2ee0bc82e7b8 | 13 | #include "driver_mbed_HP20x.h" |
TaylorGy | 0:2ee0bc82e7b8 | 14 | // #include <Wire.h> |
TaylorGy | 0:2ee0bc82e7b8 | 15 | // #include <Arduino.h> |
TaylorGy | 0:2ee0bc82e7b8 | 16 | #include "driver_mbed_KalmanFilter.h" |
TaylorGy | 0:2ee0bc82e7b8 | 17 | /****************************************************************************/ |
TaylorGy | 0:2ee0bc82e7b8 | 18 | /*** Local Variable ***/ |
TaylorGy | 0:2ee0bc82e7b8 | 19 | /****************************************************************************/ |
TaylorGy | 0:2ee0bc82e7b8 | 20 | HP20x_dev HP20x; |
TaylorGy | 0:2ee0bc82e7b8 | 21 | I2C i2c_HP20x(PB_3, PB_10); |
TaylorGy | 0:2ee0bc82e7b8 | 22 | |
TaylorGy | 0:2ee0bc82e7b8 | 23 | /****************************************************************************/ |
TaylorGy | 0:2ee0bc82e7b8 | 24 | /*** Class member Functions ***/ |
TaylorGy | 0:2ee0bc82e7b8 | 25 | /****************************************************************************/ |
TaylorGy | 0:2ee0bc82e7b8 | 26 | /* |
TaylorGy | 0:2ee0bc82e7b8 | 27 | **@ Function name: HP20x_dev |
TaylorGy | 0:2ee0bc82e7b8 | 28 | **@ Description: Constructor |
TaylorGy | 0:2ee0bc82e7b8 | 29 | **@ Input: none |
TaylorGy | 0:2ee0bc82e7b8 | 30 | **@ OutPut: none |
TaylorGy | 0:2ee0bc82e7b8 | 31 | **@ Retval: none |
TaylorGy | 0:2ee0bc82e7b8 | 32 | */ |
TaylorGy | 0:2ee0bc82e7b8 | 33 | HP20x_dev::HP20x_dev() |
TaylorGy | 0:2ee0bc82e7b8 | 34 | { |
TaylorGy | 0:2ee0bc82e7b8 | 35 | OSR_CFG = HP20X_CONVERT_OSR1024; |
TaylorGy | 0:2ee0bc82e7b8 | 36 | OSR_ConvertTime = 25; |
TaylorGy | 0:2ee0bc82e7b8 | 37 | } |
TaylorGy | 0:2ee0bc82e7b8 | 38 | |
TaylorGy | 0:2ee0bc82e7b8 | 39 | /* |
TaylorGy | 0:2ee0bc82e7b8 | 40 | **@ Function name: begin |
TaylorGy | 0:2ee0bc82e7b8 | 41 | **@ Description: Initialize HP20x_dev |
TaylorGy | 0:2ee0bc82e7b8 | 42 | **@ Input: none |
TaylorGy | 0:2ee0bc82e7b8 | 43 | **@ OutPut: none |
TaylorGy | 0:2ee0bc82e7b8 | 44 | **@ Retval: none |
TaylorGy | 0:2ee0bc82e7b8 | 45 | */ |
TaylorGy | 0:2ee0bc82e7b8 | 46 | void HP20x_dev::begin() |
TaylorGy | 0:2ee0bc82e7b8 | 47 | { |
TaylorGy | 0:2ee0bc82e7b8 | 48 | // Wire.begin(); |
TaylorGy | 0:2ee0bc82e7b8 | 49 | /* Reset HP20x_dev */ |
TaylorGy | 0:2ee0bc82e7b8 | 50 | HP20x.HP20X_IIC_WriteCmd(HP20X_SOFT_RST); |
TaylorGy | 0:2ee0bc82e7b8 | 51 | } |
TaylorGy | 0:2ee0bc82e7b8 | 52 | |
TaylorGy | 0:2ee0bc82e7b8 | 53 | /* |
TaylorGy | 0:2ee0bc82e7b8 | 54 | **@ Function name: isAvailable |
TaylorGy | 0:2ee0bc82e7b8 | 55 | **@ Description: Indicate whether it's available |
TaylorGy | 0:2ee0bc82e7b8 | 56 | **@ Input: none |
TaylorGy | 0:2ee0bc82e7b8 | 57 | **@ OutPut: none |
TaylorGy | 0:2ee0bc82e7b8 | 58 | **@ Retval: uchar |
TaylorGy | 0:2ee0bc82e7b8 | 59 | */ |
TaylorGy | 0:2ee0bc82e7b8 | 60 | uchar HP20x_dev::isAvailable() |
TaylorGy | 0:2ee0bc82e7b8 | 61 | { |
TaylorGy | 0:2ee0bc82e7b8 | 62 | uchar ret = HP20x.HP20X_IIC_ReadReg(REG_PARA); |
TaylorGy | 0:2ee0bc82e7b8 | 63 | return ret; |
TaylorGy | 0:2ee0bc82e7b8 | 64 | } |
TaylorGy | 0:2ee0bc82e7b8 | 65 | /* |
TaylorGy | 0:2ee0bc82e7b8 | 66 | **@ Function name: ReadTemperature |
TaylorGy | 0:2ee0bc82e7b8 | 67 | **@ Description: Read Temperature from HP20x_dev |
TaylorGy | 0:2ee0bc82e7b8 | 68 | **@ Input: |
TaylorGy | 0:2ee0bc82e7b8 | 69 | **@ OutPut: |
TaylorGy | 0:2ee0bc82e7b8 | 70 | **@ Retval: |
TaylorGy | 0:2ee0bc82e7b8 | 71 | */ |
TaylorGy | 0:2ee0bc82e7b8 | 72 | ulong HP20x_dev::ReadTemperature(void) |
TaylorGy | 0:2ee0bc82e7b8 | 73 | { |
TaylorGy | 0:2ee0bc82e7b8 | 74 | |
TaylorGy | 0:2ee0bc82e7b8 | 75 | HP20X_IIC_WriteCmd(HP20X_WR_CONVERT_CMD|OSR_CFG); //ADC convert |
TaylorGy | 0:2ee0bc82e7b8 | 76 | |
TaylorGy | 0:2ee0bc82e7b8 | 77 | wait_ms(int(OSR_ConvertTime)); //difference OSR_CFG will be difference OSR_ConvertTime |
TaylorGy | 0:2ee0bc82e7b8 | 78 | HP20X_IIC_WriteCmd(HP20X_READ_T); |
TaylorGy | 0:2ee0bc82e7b8 | 79 | ulong Temperature = HP20X_IIC_ReadData(); |
TaylorGy | 0:2ee0bc82e7b8 | 80 | return Temperature; |
TaylorGy | 0:2ee0bc82e7b8 | 81 | } |
TaylorGy | 0:2ee0bc82e7b8 | 82 | |
TaylorGy | 0:2ee0bc82e7b8 | 83 | /* |
TaylorGy | 0:2ee0bc82e7b8 | 84 | **@ Function name: ReadPressure |
TaylorGy | 0:2ee0bc82e7b8 | 85 | **@ Description: Read Pressure value |
TaylorGy | 0:2ee0bc82e7b8 | 86 | **@ Input: |
TaylorGy | 0:2ee0bc82e7b8 | 87 | **@ OutPut: |
TaylorGy | 0:2ee0bc82e7b8 | 88 | **@ Retval: value |
TaylorGy | 0:2ee0bc82e7b8 | 89 | */ |
TaylorGy | 0:2ee0bc82e7b8 | 90 | |
TaylorGy | 0:2ee0bc82e7b8 | 91 | ulong HP20x_dev::ReadPressure(void) |
TaylorGy | 0:2ee0bc82e7b8 | 92 | { |
TaylorGy | 0:2ee0bc82e7b8 | 93 | HP20X_IIC_WriteCmd(HP20X_WR_CONVERT_CMD|OSR_CFG); |
TaylorGy | 0:2ee0bc82e7b8 | 94 | wait_ms(int(OSR_ConvertTime)); |
TaylorGy | 0:2ee0bc82e7b8 | 95 | HP20X_IIC_WriteCmd(HP20X_READ_P); |
TaylorGy | 0:2ee0bc82e7b8 | 96 | ulong Pressure = HP20X_IIC_ReadData(); |
TaylorGy | 0:2ee0bc82e7b8 | 97 | return Pressure; |
TaylorGy | 0:2ee0bc82e7b8 | 98 | } |
TaylorGy | 0:2ee0bc82e7b8 | 99 | |
TaylorGy | 0:2ee0bc82e7b8 | 100 | /* |
TaylorGy | 0:2ee0bc82e7b8 | 101 | **@ Function name: ReadAltitude |
TaylorGy | 0:2ee0bc82e7b8 | 102 | **@ Description: Read Pressure value |
TaylorGy | 0:2ee0bc82e7b8 | 103 | **@ Input: |
TaylorGy | 0:2ee0bc82e7b8 | 104 | **@ OutPut: |
TaylorGy | 0:2ee0bc82e7b8 | 105 | **@ Retval: value |
TaylorGy | 0:2ee0bc82e7b8 | 106 | */ |
TaylorGy | 0:2ee0bc82e7b8 | 107 | ulong HP20x_dev::ReadAltitude(void) |
TaylorGy | 0:2ee0bc82e7b8 | 108 | { |
TaylorGy | 0:2ee0bc82e7b8 | 109 | HP20X_IIC_WriteCmd(HP20X_READ_A); |
TaylorGy | 0:2ee0bc82e7b8 | 110 | ulong Altitude = HP20X_IIC_ReadData(); |
TaylorGy | 0:2ee0bc82e7b8 | 111 | return Altitude; |
TaylorGy | 0:2ee0bc82e7b8 | 112 | } |
TaylorGy | 0:2ee0bc82e7b8 | 113 | |
TaylorGy | 0:2ee0bc82e7b8 | 114 | /* |
TaylorGy | 0:2ee0bc82e7b8 | 115 | void ReadPressureAndTemperature(void) |
TaylorGy | 0:2ee0bc82e7b8 | 116 | { |
TaylorGy | 0:2ee0bc82e7b8 | 117 | HP20X_IIC_WriteCmd(HP20X_WR_CONVERT_CMD|OSR_CFG); |
TaylorGy | 0:2ee0bc82e7b8 | 118 | Timer_Delayxms(OSR_ConvertTime*2); |
TaylorGy | 0:2ee0bc82e7b8 | 119 | HP20X_IIC_WriteCmd(HP20X_READ_PT); |
TaylorGy | 0:2ee0bc82e7b8 | 120 | |
TaylorGy | 0:2ee0bc82e7b8 | 121 | Temperature=HP20X_IIC_ReadData(); |
TaylorGy | 0:2ee0bc82e7b8 | 122 | |
TaylorGy | 0:2ee0bc82e7b8 | 123 | Pressure=HP20X_IIC_ReadData3byte(); |
TaylorGy | 0:2ee0bc82e7b8 | 124 | } |
TaylorGy | 0:2ee0bc82e7b8 | 125 | |
TaylorGy | 0:2ee0bc82e7b8 | 126 | void IIC_ReadAltitudeAndTemperature(void) |
TaylorGy | 0:2ee0bc82e7b8 | 127 | { |
TaylorGy | 0:2ee0bc82e7b8 | 128 | |
TaylorGy | 0:2ee0bc82e7b8 | 129 | HP20X_IIC_WriteCmd(HP20X_WR_CONVERT_CMD|OSR_CFG); |
TaylorGy | 0:2ee0bc82e7b8 | 130 | Timer_Delayxms(OSR_ConvertTime*2); |
TaylorGy | 0:2ee0bc82e7b8 | 131 | HP20X_IIC_WriteCmd(HP20X_READ_AT); |
TaylorGy | 0:2ee0bc82e7b8 | 132 | |
TaylorGy | 0:2ee0bc82e7b8 | 133 | Temperature=HP20X_IIC_ReadData(); |
TaylorGy | 0:2ee0bc82e7b8 | 134 | IIC_ACK(); |
TaylorGy | 0:2ee0bc82e7b8 | 135 | Altitude=HP20X_IIC_ReadData3byte(); |
TaylorGy | 0:2ee0bc82e7b8 | 136 | IIC_NoAck(); |
TaylorGy | 0:2ee0bc82e7b8 | 137 | IIC_Stop(); |
TaylorGy | 0:2ee0bc82e7b8 | 138 | |
TaylorGy | 0:2ee0bc82e7b8 | 139 | }*/ |
TaylorGy | 0:2ee0bc82e7b8 | 140 | /****************************************************************************/ |
TaylorGy | 0:2ee0bc82e7b8 | 141 | /*** Local Functions ***/ |
TaylorGy | 0:2ee0bc82e7b8 | 142 | /****************************************************************************/ |
TaylorGy | 0:2ee0bc82e7b8 | 143 | |
TaylorGy | 0:2ee0bc82e7b8 | 144 | /* |
TaylorGy | 0:2ee0bc82e7b8 | 145 | **@ Function name: HP20X_IIC_WriteCmd |
TaylorGy | 0:2ee0bc82e7b8 | 146 | **@ Description: |
TaylorGy | 0:2ee0bc82e7b8 | 147 | **@ Input: |
TaylorGy | 0:2ee0bc82e7b8 | 148 | **@ OutPut: |
TaylorGy | 0:2ee0bc82e7b8 | 149 | **@ Retval: |
TaylorGy | 0:2ee0bc82e7b8 | 150 | */ |
TaylorGy | 0:2ee0bc82e7b8 | 151 | void HP20x_dev::HP20X_IIC_WriteCmd(uchar uCmd) |
TaylorGy | 0:2ee0bc82e7b8 | 152 | { |
TaylorGy | 0:2ee0bc82e7b8 | 153 | /* Port to arduino */ |
TaylorGy | 0:2ee0bc82e7b8 | 154 | // Wire.beginTransmission(HP20X_I2C_DEV_ID); |
TaylorGy | 0:2ee0bc82e7b8 | 155 | // Wire.write(uCmd); |
TaylorGy | 0:2ee0bc82e7b8 | 156 | // Wire.endTransmission(); |
TaylorGy | 0:2ee0bc82e7b8 | 157 | char cmd = uCmd; |
TaylorGy | 0:2ee0bc82e7b8 | 158 | i2c_HP20x.write(HP20X_I2C_DEV_ID, &cmd, 1); |
TaylorGy | 0:2ee0bc82e7b8 | 159 | } |
TaylorGy | 0:2ee0bc82e7b8 | 160 | |
TaylorGy | 0:2ee0bc82e7b8 | 161 | /* |
TaylorGy | 0:2ee0bc82e7b8 | 162 | **@ Function name: HP20X_IIC_ReadReg |
TaylorGy | 0:2ee0bc82e7b8 | 163 | **@ Description: |
TaylorGy | 0:2ee0bc82e7b8 | 164 | **@ Input: |
TaylorGy | 0:2ee0bc82e7b8 | 165 | **@ OutPut: |
TaylorGy | 0:2ee0bc82e7b8 | 166 | **@ Retval: |
TaylorGy | 0:2ee0bc82e7b8 | 167 | */ |
TaylorGy | 0:2ee0bc82e7b8 | 168 | uchar HP20x_dev::HP20X_IIC_ReadReg(uchar bReg) |
TaylorGy | 0:2ee0bc82e7b8 | 169 | { |
TaylorGy | 0:2ee0bc82e7b8 | 170 | /* Port to arduino */ |
TaylorGy | 0:2ee0bc82e7b8 | 171 | char Temp; |
TaylorGy | 0:2ee0bc82e7b8 | 172 | |
TaylorGy | 0:2ee0bc82e7b8 | 173 | /* Send a register reading command */ |
TaylorGy | 0:2ee0bc82e7b8 | 174 | HP20X_IIC_WriteCmd(bReg|HP20X_RD_REG_MODE); |
TaylorGy | 0:2ee0bc82e7b8 | 175 | |
TaylorGy | 0:2ee0bc82e7b8 | 176 | // Wire.requestFrom(HP20X_I2C_DEV_ID, 1); |
TaylorGy | 0:2ee0bc82e7b8 | 177 | // while(Wire.available()) |
TaylorGy | 0:2ee0bc82e7b8 | 178 | // { |
TaylorGy | 0:2ee0bc82e7b8 | 179 | // Temp = Wire.read(); |
TaylorGy | 0:2ee0bc82e7b8 | 180 | // } |
TaylorGy | 0:2ee0bc82e7b8 | 181 | i2c_HP20x.read(HP20X_I2C_DEV_ID, &Temp, 1); |
TaylorGy | 0:2ee0bc82e7b8 | 182 | |
TaylorGy | 0:2ee0bc82e7b8 | 183 | return Temp; |
TaylorGy | 0:2ee0bc82e7b8 | 184 | } |
TaylorGy | 0:2ee0bc82e7b8 | 185 | /* |
TaylorGy | 0:2ee0bc82e7b8 | 186 | **@ Function name: HP20X_IIC_WriteReg |
TaylorGy | 0:2ee0bc82e7b8 | 187 | **@ Description: |
TaylorGy | 0:2ee0bc82e7b8 | 188 | **@ Input: |
TaylorGy | 0:2ee0bc82e7b8 | 189 | **@ OutPut: |
TaylorGy | 0:2ee0bc82e7b8 | 190 | **@ Retval: |
TaylorGy | 0:2ee0bc82e7b8 | 191 | */ |
TaylorGy | 0:2ee0bc82e7b8 | 192 | void HP20x_dev::HP20X_IIC_WriteReg(uchar bReg,uchar bData) |
TaylorGy | 0:2ee0bc82e7b8 | 193 | { |
TaylorGy | 0:2ee0bc82e7b8 | 194 | // Wire.beginTransmission(HP20X_I2C_DEV_ID); |
TaylorGy | 0:2ee0bc82e7b8 | 195 | // Wire.write(bReg|HP20X_WR_REG_MODE); |
TaylorGy | 0:2ee0bc82e7b8 | 196 | // Wire.write(bData); |
TaylorGy | 0:2ee0bc82e7b8 | 197 | // Wire.endTransmission(); |
TaylorGy | 0:2ee0bc82e7b8 | 198 | char cmd[2]; |
TaylorGy | 0:2ee0bc82e7b8 | 199 | cmd[0] = bReg|HP20X_WR_REG_MODE; |
TaylorGy | 0:2ee0bc82e7b8 | 200 | cmd[1] = bData; |
TaylorGy | 0:2ee0bc82e7b8 | 201 | i2c_HP20x.write(HP20X_I2C_DEV_ID, cmd, 2); |
TaylorGy | 0:2ee0bc82e7b8 | 202 | } |
TaylorGy | 0:2ee0bc82e7b8 | 203 | |
TaylorGy | 0:2ee0bc82e7b8 | 204 | |
TaylorGy | 0:2ee0bc82e7b8 | 205 | /* |
TaylorGy | 0:2ee0bc82e7b8 | 206 | **@ Function name: HP20X_IIC_ReadData |
TaylorGy | 0:2ee0bc82e7b8 | 207 | **@ Description: |
TaylorGy | 0:2ee0bc82e7b8 | 208 | **@ Input: |
TaylorGy | 0:2ee0bc82e7b8 | 209 | **@ OutPut: |
TaylorGy | 0:2ee0bc82e7b8 | 210 | **@ Retval: |
TaylorGy | 0:2ee0bc82e7b8 | 211 | */ |
TaylorGy | 0:2ee0bc82e7b8 | 212 | ulong HP20x_dev::HP20X_IIC_ReadData(void) |
TaylorGy | 0:2ee0bc82e7b8 | 213 | { |
TaylorGy | 0:2ee0bc82e7b8 | 214 | /* Port to arduino */ |
TaylorGy | 0:2ee0bc82e7b8 | 215 | ulong Temp = HP20X_IIC_ReadData3byte(); |
TaylorGy | 0:2ee0bc82e7b8 | 216 | return Temp; |
TaylorGy | 0:2ee0bc82e7b8 | 217 | } |
TaylorGy | 0:2ee0bc82e7b8 | 218 | |
TaylorGy | 0:2ee0bc82e7b8 | 219 | /* |
TaylorGy | 0:2ee0bc82e7b8 | 220 | **@ Function name: HP20X_IIC_ReadData3byte |
TaylorGy | 0:2ee0bc82e7b8 | 221 | **@ Description: |
TaylorGy | 0:2ee0bc82e7b8 | 222 | **@ Input: |
TaylorGy | 0:2ee0bc82e7b8 | 223 | **@ OutPut: |
TaylorGy | 0:2ee0bc82e7b8 | 224 | **@ Retval: |
TaylorGy | 0:2ee0bc82e7b8 | 225 | */ |
TaylorGy | 0:2ee0bc82e7b8 | 226 | ulong HP20x_dev::HP20X_IIC_ReadData3byte(void) |
TaylorGy | 0:2ee0bc82e7b8 | 227 | { |
TaylorGy | 0:2ee0bc82e7b8 | 228 | ulong TempData = 0; |
TaylorGy | 0:2ee0bc82e7b8 | 229 | char tmpArray[3]; |
TaylorGy | 0:2ee0bc82e7b8 | 230 | |
TaylorGy | 0:2ee0bc82e7b8 | 231 | /* Require three bytes from slave */ |
TaylorGy | 0:2ee0bc82e7b8 | 232 | // Wire.requestFrom(HP20X_I2C_DEV_ID, 3); |
TaylorGy | 0:2ee0bc82e7b8 | 233 | |
TaylorGy | 0:2ee0bc82e7b8 | 234 | // while(Wire.available()) // slave may send less than requested |
TaylorGy | 0:2ee0bc82e7b8 | 235 | // { |
TaylorGy | 0:2ee0bc82e7b8 | 236 | // uchar c = Wire.read(); // receive a byte as character |
TaylorGy | 0:2ee0bc82e7b8 | 237 | // tmpArray[cnt] = (ulong)c; |
TaylorGy | 0:2ee0bc82e7b8 | 238 | // cnt++; |
TaylorGy | 0:2ee0bc82e7b8 | 239 | // } |
TaylorGy | 0:2ee0bc82e7b8 | 240 | i2c_HP20x.read(HP20X_I2C_DEV_ID, tmpArray, 3); |
TaylorGy | 0:2ee0bc82e7b8 | 241 | |
TaylorGy | 0:2ee0bc82e7b8 | 242 | /* MSB */ |
TaylorGy | 0:2ee0bc82e7b8 | 243 | TempData = tmpArray[0]<<16 | tmpArray[1]<<8 | tmpArray[2]; |
TaylorGy | 0:2ee0bc82e7b8 | 244 | |
TaylorGy | 0:2ee0bc82e7b8 | 245 | |
TaylorGy | 0:2ee0bc82e7b8 | 246 | if(TempData&0x800000) |
TaylorGy | 0:2ee0bc82e7b8 | 247 | { |
TaylorGy | 0:2ee0bc82e7b8 | 248 | TempData|=0xff000000; |
TaylorGy | 0:2ee0bc82e7b8 | 249 | } |
TaylorGy | 0:2ee0bc82e7b8 | 250 | |
TaylorGy | 0:2ee0bc82e7b8 | 251 | /* // 24 bit to 32 bit |
TaylorGy | 0:2ee0bc82e7b8 | 252 | if(TempData&0x800000) |
TaylorGy | 0:2ee0bc82e7b8 | 253 | { |
TaylorGy | 0:2ee0bc82e7b8 | 254 | // 1:minus |
TaylorGy | 0:2ee0bc82e7b8 | 255 | TempData |= 0x80000000; |
TaylorGy | 0:2ee0bc82e7b8 | 256 | TempData &= 0xff7fffff; |
TaylorGy | 0:2ee0bc82e7b8 | 257 | } |
TaylorGy | 0:2ee0bc82e7b8 | 258 | else |
TaylorGy | 0:2ee0bc82e7b8 | 259 | { |
TaylorGy | 0:2ee0bc82e7b8 | 260 | // 0:plus |
TaylorGy | 0:2ee0bc82e7b8 | 261 | //do noting |
TaylorGy | 0:2ee0bc82e7b8 | 262 | } */ |
TaylorGy | 0:2ee0bc82e7b8 | 263 | return TempData; |
TaylorGy | 0:2ee0bc82e7b8 | 264 | } |
TaylorGy | 0:2ee0bc82e7b8 | 265 | |
TaylorGy | 0:2ee0bc82e7b8 | 266 | /**************************************END OF FILE**************************************/ |