00001 /* 00002 * Copyright (C) 2009 Libelium Comunicaciones Distribuidas S.L. 00003 * http://www.libelium.com 00004 * 00005 * This program is free software: you can redistribute it and/or modify 00006 * it under the terms of the GNU Lesser General Public License as published by 00007 * the Free Software Foundation, either version 2.1 of the License, or 00008 * (at your option) any later version. 00009 00010 * This program is distributed in the hope that it will be useful, 00011 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00013 * GNU Lesser General Public License for more details. 00014 00015 * You should have received a copy of the GNU Lesser General Public License 00016 * along with this program. If not, see <http://www.gnu.org/licenses/>. 00017 * 00018 * Version: 0.6 00019 * Design: David Gascón 00020 * Implementation: David Cuartielles, Alberto Bielsa 00021 */ 00022 00023 00024 #ifndef __WPROGRAM_H__ 00025 #include <WaspClasses.h> 00026 #endif 00027 00028 // Variables /////////////////////////////////////////////////////////////////// 00029 00030 // Constructors //////////////////////////////////////////////////////////////// 00031 00032 WaspACC::WaspACC() 00033 { 00034 // nothing to do 00035 } 00036 00037 // Public Methods ////////////////////////////////////////////////////////////// 00038 00039 /******************************************************************************* 00040 * QUICK BOOTING AND CONFIGURATION OF THE SENSOR 00041 *******************************************************************************/ 00042 00043 /* 00044 * ON (void) - It opens I2C bus and powers the accelerometer 00045 * 00046 * It opens I2C bus and powers the accelerometer 00047 */ 00048 void WaspACC::ON(void) 00049 { 00050 begin(); 00051 setMode(ACC_ON); 00052 } 00053 00054 00055 /* 00056 * begin (void) - initialize the accelerometer 00057 * 00058 * It initializes communication with I2C bus 00059 * it makes no tests and checks nothing from the communication, therefore 00060 * returns nothing and modifies no flags 00061 */ 00062 void WaspACC::begin(void) 00063 { 00064 00065 // Sets RTC on to enable I2C 00066 RTC.setMode(RTC_ON); 00067 00068 accMode = ACC_ON; // by default the accelerometer will be in continuous mode 00069 // this should be changed once Wasp is released, by default 00070 // the system should be in standby, and with the communication 00071 // disabled 00072 00073 Wire.begin(); // join i2c bus (address optional for master) 00074 00075 00076 // start the communication by 00077 // making sure we have the right data in 00078 // the control registers 00079 00080 // register 2 takes care rebooting, and turning on/off 00081 // the free fall filters 00082 // writeRegister(ctrlReg2, B00000000); 00083 /* 00084 * MSB - fs: full scale selection, 0=2g, 1=6g 00085 * bdu: block data update, 0=continuous, 1=when MSB/LSB has been read 00086 * ble: big little endian, 0=little, 1=big 00087 * boot: reboot factory defaults 00088 * ien: interrupt enable, 0=data ready on RDY , 1=int. request on RDY 00089 * drdy: data ready generation, 0 for 0 on RDY, 1 for 1 on RDY 00090 * sim: SPI 4/3 wire, 0=4 wires, 1=3 wires 00091 * LSB - das: 0=12 bit signed, 1=16 bits unsigned 00092 */ 00093 00094 // register 1 will decide upon the different acceleration, sample rate, 00095 // will enable the different axes and will control if the sensor is 00096 // in power down mode 00097 // writeRegister(ctrlReg1, B01000111); 00098 /* 00099 * MSB - pd1, pd0: 00 means power down, 01, 10, 11 are power on 00100 * df1, df0: decimation factor, 00=512, 01=128, 10=32, 11=8 00101 * sfe: self test enable, 0=normal, 1=active 00102 * z enable 00103 * y enable 00104 * LSB - x enable 00105 */ 00106 00107 // mostly takes care of filter activations and such 00108 // writeRegister(ctrlReg3, B00001000); 00109 // in theory the pin we are trying to write to should be reserved 00110 // therefore this operation should not be needed 00111 /* 00112 * MSB - eck - External Clock. Default value: 0 00113 * hpdd - (0: clock from internal oscillator; 1: clock from external pad) 00114 * High Pass filter enabled for Direction Detection. Default value: 0 00115 * hpff - (0: filter bypassed; 1: filter enabled) 00116 * High Pass filter enabled for Free-Fall and Wake-Up. Default value: 0 00117 * fds - (0: filter bypassed; 1: filter enabled) 00118 * Filtered Data Selection. Default value: 0 00119 * res - Reserved. These bit are reserved for future enhancements. 00120 * Best to be left to their default value (10 binary) 00121 * res 00122 * cfs1, cfs0 - (0: internal filter bypassed; 1: data from internal filter) 00123 * High-pass filter Cut-off Frequency Selection. Default value: 00 00124 * (00: Hpc=512 00125 * 01: Hpc=1024 00126 * 10: Hpc=2048 00127 * 11: Hpc=4096) 00128 */ 00129 } 00130 00131 /* 00132 * boot (void) - reboot the accelerometer 00133 * 00134 * takes for granted the accelerometer is on and forces the sensor to reboot 00135 * by writing to the control register #2 into the right pin 00136 * it makes no tests and checks nothing from the communication, therefore 00137 * returns nothing and modifies no flags 00138 */ 00139 void WaspACC::boot(void) 00140 { 00141 // send reboot command 00142 writeRegister(ctrlReg2, B00010000); 00143 00144 delay(1); // make a short pause after rebooting 00145 00146 writeRegister(ctrlReg2, B00000000); 00147 00148 } 00149 00150 /* 00151 * close (void) - closes I2C bus 00152 * 00153 * It closes I2C bus. Accelerometer uses I2C to communicate with microcontroller. 00154 * 00155 * It is used to keep the battery to the maximum 00156 */ 00157 void WaspACC::close(void) 00158 { 00159 setMode(ACC_HIBERNATE); 00160 PWR.closeI2C(); 00161 } 00162 00163 /******************************************************************************* 00164 * CHECK ACCELEROMETER'S STATUS 00165 *******************************************************************************/ 00166 00167 /* 00168 * getStatus (void) - gets the accelerometer status 00169 * 00170 * returns a byte containing the status of the accelerometer as read from 00171 * the proper register. It won't activate any flags by itself, but activates 00172 * ACC_COMM_ERROR in case there was an error writing to the register 00173 */ 00174 uint8_t WaspACC::getStatus(void) 00175 { 00176 return (uint8_t) readRegister(statusReg); 00177 } 00178 00179 /* 00180 * getWhoAmI (void) - checks if there is an accelerometer on board 00181 * 00182 * sends the accelerometer dummy register on 0x0F that should always answer 0x3A 00183 * 00184 * This function can be used to determine if the accelerometer is on the board 00185 * but also to check if it is still working properly. Any answer other than 00186 * 0x3A means there is an error 00187 * 00188 * since it calls readRegister, getWhoAmI won't activate any flags by itself, 00189 * but the other functions will activate ACC_COMM_ERROR in case there 00190 * was an error communicating to the register 00191 */ 00192 uint8_t WaspACC::check(void) 00193 { 00194 return (uint8_t) readRegister(whoAmIReg); 00195 } 00196 00197 /******************************************************************************* 00198 * HANDLE THE CONFIGURATION REGISTERS, BOTH READ AND WRITE 00199 *******************************************************************************/ 00200 00201 /* 00202 * getCTRL1 (void) - checks accelerometer's control register 1 00203 * 00204 * returns the contents of control register 1 00205 * 00206 * since it calls readRegister, getCTRL1 won't activate any flags by itself, 00207 * but the other functions will activate ACC_COMM_ERROR in case there 00208 * was an error communicating to the register 00209 */ 00210 uint8_t WaspACC::getCTRL1(void) 00211 { 00212 return (uint8_t) readRegister(ctrlReg1); 00213 } 00214 00215 /* 00216 * setCTRL1 (void) - sets accelerometer's control register 1 00217 * 00218 * sets the contents of control register 1, returns 1 if error 00219 * 00220 * since it calls writeRegister, setCTRL1 won't activate any flags by itself, 00221 * but the other functions will activate ACC_COMM_ERROR in case there 00222 * was an error communicating to the register 00223 */ 00224 uint8_t WaspACC::setCTRL1(uint8_t val) 00225 { 00226 return (uint8_t) writeRegister(ctrlReg1, val); 00227 } 00228 00229 /* 00230 * getCTRL2 (void) - checks accelerometer's control register 2 00231 * 00232 * returns the contents of control register 2 00233 * 00234 * since it calls readRegister, getCTRL2 won't activate any flags by itself, 00235 * but the other functions will activate ACC_COMM_ERROR in case there 00236 * was an error communicating to the register 00237 */ 00238 uint8_t WaspACC::getCTRL2(void) 00239 { 00240 return (uint8_t) readRegister(ctrlReg2); 00241 } 00242 00243 /* 00244 * setCTRL2 (void) - sets accelerometer's control register 2 00245 * 00246 * sets the contents of control register 2, returns 1 if error 00247 * 00248 * since it calls writeRegister, setCTRL2 won't activate any flags by itself, 00249 * but the other functions will activate ACC_COMM_ERROR in case there 00250 * was an error communicating to the register 00251 */ 00252 uint8_t WaspACC::setCTRL2(uint8_t val) 00253 { 00254 return (uint8_t) writeRegister(ctrlReg2, val); 00255 } 00256 00257 /* 00258 * getCTRL3 (void) - checks accelerometer's control register 3 00259 * 00260 * returns the contents of control register 3 00261 * 00262 * since it calls readRegister, getCTRL3 won't activate any flags by itself, 00263 * but the other functions will activate ACC_COMM_ERROR in case there 00264 * was an error communicating to the register 00265 */ 00266 uint8_t WaspACC::getCTRL3(void) 00267 { 00268 return (uint8_t) readRegister(ctrlReg3); 00269 } 00270 00271 /* 00272 * setCTRL3 (void) - sets accelerometer's control register 3 00273 * 00274 * sets the contents of control register 3, returns 1 if error 00275 * 00276 * since it calls writeRegister, setCTRL3 won't activate any flags by itself, 00277 * but the other functions will activate ACC_COMM_ERROR in case there 00278 * was an error communicating to the register 00279 */ 00280 uint8_t WaspACC::setCTRL3(uint8_t val) 00281 { 00282 return (uint8_t) writeRegister(ctrlReg3, val); 00283 } 00284 00285 /* 00286 * getADCmode (void) - gets the accelerometer's ADC mode 00287 * 00288 * returns '0' if success, '-1' if error 00289 * 00290 * since it calls readRegister, getADCmode won't activate any flags by itself, 00291 * but the other functions will activate ACC_COMM_ERROR in case there 00292 * was an error communicating to the register 00293 */ 00294 uint8_t WaspACC::getADCmode(void) 00295 { 00296 return readRegister(ctrlReg2) && B01; 00297 } 00298 00299 /* 00300 * setADCmode (bit) - sets the accelerometer's ADC mode 00301 * 00302 * writes, inside the CTRL2 whether the ADC should operate in 12 or 16bits. Values 00303 * are zero (0) for 12 bits right aligned (MSB represents the sign) and one (1) 00304 * for 16 bits left aligned 00305 * 00306 * since it calls writeRegister, setADCmode won't activate any flags by itself, 00307 * but the other functions will activate ACC_COMM_ERROR in case there 00308 * was an error communicating to the register 00309 */ 00310 uint8_t WaspACC::setADCmode(uint8_t val) 00311 { 00312 uint8_t aux = readRegister(ctrlReg2); 00313 aux &= B11111110; 00314 aux |= val; 00315 return writeRegister(ctrlReg2, aux); 00316 } 00317 00318 00319 /* 00320 * setSamplingRate (rate) - sets the accelerometer's sampling rate 00321 * 00322 * writes, inside the CTRL1 the samplin rate desired 00323 * 00324 * since it calls writeRegister, setADCmode won't activate any flags by itself, 00325 * but the other functions will activate ACC_COMM_ERROR in case there 00326 * was an error communicating to the register 00327 */ 00328 uint8_t WaspACC::setSamplingRate(uint8_t rate) 00329 { 00330 uint8_t aux = readRegister(ctrlReg1); 00331 aux &= B11001111; 00332 00333 switch( rate ) 00334 { 00335 case ACC_RATE_40 : aux |= rate; 00336 break; 00337 case ACC_RATE_160 : aux |= B00010000; 00338 break; 00339 case ACC_RATE_640 : aux |= B00100000; 00340 break; 00341 case ACC_RATE_2560 : aux |= B00110000; 00342 break; 00343 } 00344 return writeRegister(ctrlReg1, aux); 00345 } 00346 00347 00348 /******************************************************************************* 00349 * GET ACCELERATION ON THE THREE AXIS 00350 *******************************************************************************/ 00351 00352 /* 00353 * getX (void) - checks accelerometer's acceleration on OX 00354 * 00355 * returns the combined contents of data registers outXhigh and outXlow as an 00356 * integer according to ADC's configuration 00357 * 00358 * since it calls readRegister, getX won't activate any flags by itself, 00359 * but the other functions will activate ACC_COMM_ERROR in case there 00360 * was an error communicating to the register 00361 */ 00362 int16_t WaspACC::getX(void) 00363 { 00364 int16_t aux = readRegister(outXhigh)*256 + readRegister(outXlow); 00365 return aux; 00366 } 00367 00368 /* 00369 * getY (void) - checks accelerometer's acceleration on OY 00370 * 00371 * returns the combined contents of data registers outYhigh and outYlow as an 00372 * integer according to ADC's configuration 00373 * 00374 * since it calls readRegister, getY won't activate any flags by itself, 00375 * but the other functions will activate ACC_COMM_ERROR in case there 00376 * was an error communicating to the register 00377 */ 00378 int16_t WaspACC::getY(void) 00379 { 00380 int16_t aux = readRegister(outYhigh)*256 + readRegister(outYlow); 00381 return aux; 00382 } 00383 00384 /* 00385 * getZ (void) - checks accelerometer's acceleration on OZ 00386 * 00387 * returns the combined contents of data registers outZhigh and outZlow as an 00388 * integer according to ADC's configuration 00389 * 00390 * since it calls readRegister, getZ won't activate any flags by itself, 00391 * but the other functions will activate ACC_COMM_ERROR in case there 00392 * was an error communicating to the register 00393 */ 00394 int16_t WaspACC::getZ(void) 00395 { 00396 int16_t aux = readRegister(outZhigh)*256 + readRegister(outZlow); 00397 return aux; 00398 } 00399 00400 /******************************************************************************* 00401 * HANDLE ACCELEROMETER'S WORK MODES * 00402 *******************************************************************************/ 00403 00404 /* 00405 * getMode (void) - checks accelerometer's work mode 00406 * 00407 * returns the value for the accelerometer's work mode, the possibilites are: 00408 * - ACC_INT: wake up the processor on preprogammed interrupt (free fall or deviation) 00409 * - ACC_CONTINUOUS: read/send at a constant pace upon request 00410 * - ACC_CUSTOM: user defined work mode 00411 * 00412 * It doesn't call any other functions and therefore it won't activate any flags 00413 */ 00414 uint8_t WaspACC::getMode() 00415 { 00416 return accMode; 00417 } 00418 00419 /* 00420 * setMode (uint8_t) - sets accelerometer's work mode 00421 * 00422 * configures the accelerometer to a new work mode, the possibilites are: 00423 * - ACC_HIBERNATE: go on the lowest power mode possible. This mode has no interrupt 00424 * calls and therefore won't disturb the processor if anything happened 00425 * - ACC_ON: read/send at a constant pace upon request 00426 * - ACC_CUSTOM: user defined work mode, should be programmed in here 00427 * 00428 * since it calls writeRegister, setAccMode won't activate any flags by itself, 00429 * but the other functions will activate ACC_COMM_ERROR in case there 00430 * was an error communicating to the register 00431 */ 00432 uint8_t WaspACC::setMode(uint8_t mode) 00433 { 00434 accMode = mode; 00435 00436 if (mode == ACC_HIBERNATE) 00437 { 00438 writeRegister(ctrlReg2,B00000000); // de-activate RDY 00439 writeRegister(ctrlReg1,B00000111); // turn power off 00440 } 00441 00442 if (mode == ACC_ON) 00443 { 00444 writeRegister(ctrlReg2, B00000000); 00445 writeRegister(ctrlReg1, B01000111); // turn power ON 00446 writeRegister(ctrlReg3, B00001000); 00447 } 00448 00449 if (mode == ACC_CUSTOM) 00450 { 00451 // here the custom mode has to be defined by expert users 00452 } 00453 00454 // go out with no error, leaves room to implement an error function 00455 return 0; 00456 } 00457 00458 /******************************************************************************* 00459 * SPECIFIC WASP FUNCTIONS TO HANDLE EVENTS 00460 *******************************************************************************/ 00461 00462 /* 00463 * setFF (void) - sets the Free Fall interrupt 00464 */ 00465 uint8_t WaspACC::setFF(void) 00466 { 00467 // clear the FF interrupt if active 00468 unsetFF(); 00469 00470 // configure the different registers to 00471 // handle acceleration detection on the X, Y, or Z axis 00472 ACC.writeRegister(ctrlReg1, 0xC7); 00473 ACC.writeRegister(ctrlReg2, 0x08); 00474 ACC.writeRegister(ctrlReg3, 0x08); 00475 00476 // here we have to double-check if we 00477 // are in 12 or 16bit data modes. The 12 00478 // bit data mode is giving away the 4LSBs 00479 // therefore the register needs to be written 00480 // according to that. 0x3C00 is just below 1g 00481 // but the acc will give 0x03C0, beware! 00482 writeRegister(FF_WU_THS_L, FF_WU_THS_L_val); // threshold L 00483 writeRegister(FF_WU_THS_H, FF_WU_THS_H_val); // threshold H 00484 writeRegister(FF_WU_DURATION, FF_WU_DURATION_val); // event duration 00485 // readRegister(HP_FILTER_RESET); // config the acc. to get current acceleration as initial val 00486 writeRegister(FF_WU_CFG, FF_WU_CFG_val); // config accelerometer to wake up 00487 00488 // assign the ACC_FREE_FALL mode 00489 AccEventMode |= ACC_FREE_FALL; 00490 00491 // attach the hardware interrupt to the pin 00492 attachInt(); 00493 00494 return flag; 00495 } 00496 00497 /* 00498 * unsetFF (void) - clears and unsets the Free Fall interrupt 00499 */ 00500 uint8_t WaspACC::unsetFF(void) 00501 { 00502 00503 writeRegister(FF_WU_CFG, 0x00); 00504 readRegister(FF_WU_ACK); // clear the interrupt flag 00505 00506 // detach the event if there are no flags active 00507 AccEventMode &= ~(ACC_FREE_FALL); 00508 if (!AccEventMode) detachInt(); 00509 return flag; 00510 } 00511 00512 /* 00513 * setDD (uint8_t) - sets the Direction Change interrupt 00514 */ 00515 uint8_t WaspACC::setDD(uint8_t directions) 00516 { 00517 // make sure it gets configured for whatever direction 00518 // people choose like e.g. XHIE or ZLIE 00519 directions |= (IEND | LIR); 00520 00521 // clear the DD interrupt if active 00522 unsetDD(); 00523 00524 // configure the different registers to 00525 // handle acceleration detection on the X, Y, or Z axis 00526 writeRegister(ctrlReg1, 0xC7); 00527 writeRegister(ctrlReg2, 0x08); 00528 writeRegister(ctrlReg3, 0x4B); 00529 00530 // here we have to double-check if we 00531 // are in 12 or 16bit data modes. The 12 00532 // bit data mode is giving away the 4LSBs 00533 // therefore the register needs to be written 00534 // according to that. 0x3C00 is just below 1g 00535 // but the acc will give 0x03C0, beware! 00536 writeRegister(DD_THSI_L, DD_THSI_L_val); // threshold L internal 00537 writeRegister(DD_THSI_H, DD_THSI_H_val); // threshold H internal 00538 writeRegister(DD_THSE_L, DD_THSE_L_val); // threshold L external 00539 writeRegister(DD_THSE_H, DD_THSE_H_val); // threshold H external 00540 readRegister(HP_FILTER_RESET); // config the acc. to get current acceleration as initial val 00541 writeRegister(DD_CFG, directions); // config accelerometer to wake up 00542 00543 // assign the ACC_FREE_FALL mode 00544 AccEventMode |= ACC_DIRECTION; 00545 00546 // attach the hardware interrupt to the pin 00547 attachInt(); 00548 00549 return flag; 00550 } 00551 00552 /* 00553 * unsetDD (void) - clears and unsets the Direction Change interrupt 00554 */ 00555 uint8_t WaspACC::unsetDD(void) 00556 { 00557 00558 writeRegister(DD_CFG, 0x00); 00559 readRegister(DD_ACK); // clear the interrupt flag 00560 00561 // detach the event if there are no flags active 00562 AccEventMode &= ~(ACC_DIRECTION); 00563 if (!AccEventMode) detachInt(); 00564 return flag; 00565 } 00566 00567 /* 00568 * getAccEvent (void) - returns the event type on the accelerometer 00569 * 00570 * will be zero if there are no values set, bigger otherwise 00571 * 00572 * It doesn't call any other functions and therefore it won't activate any flags 00573 */ 00574 uint8_t WaspACC::getAccEvent(void) 00575 { 00576 return AccEventMode; 00577 } 00578 00579 /* 00580 * setAccEvent (mode) - sets the event type on the accelerometer 00581 * 00582 * It will set up the type of event, they are non exclusive and could be: 00583 * 00584 * - ACC_NONE 00585 * - ACC_FREE_FALL 00586 * - ACC_DIRECTION 00587 * - ACC_THRESHOLD 00588 */ 00589 uint8_t WaspACC::setAccEvent(uint8_t mode) 00590 { 00591 AccEventMode = mode; 00592 00593 if (mode & ACC_DIRECTION) 00594 { 00595 } 00596 00597 if (mode == ACC_FREE_FALL) 00598 { 00599 } 00600 00601 if (mode == ACC_NONE) 00602 { 00603 } 00604 00605 // go out with no error, leaves room to implement an error function 00606 return 0; 00607 } 00608 00609 /******************************************************************************* 00610 * HANDLING HARDWARE INTERRUPTS 00611 *******************************************************************************/ 00612 00613 /* 00614 * attachInterrupt(void) - configure the specific hardware interrupt for the acc 00615 * 00616 * the default interrupt functions are defined inside WInterrupts.c 00617 */ 00618 void WaspACC::attachInt(void) 00619 { 00620 enableInterrupts(ACC_INT); 00621 } 00622 00623 /* 00624 * detachInterrupt(void) - unset the specific hardware interrupt for the acc 00625 */ 00626 void WaspACC::detachInt(void) 00627 { 00628 disableInterrupts(ACC_INT); 00629 } 00630 00631 00632 /* 00633 * clearAlarmFlag() - clears the Accelerometer's alarm flag 00634 */ 00635 void WaspACC::clearAlarmFlag(void) 00636 { 00637 writeRegister(FF_WU_CFG, 0x00); 00638 readRegister(FF_WU_ACK); // clear the interrupt flag 00639 00640 writeRegister(DD_CFG, 0x00); 00641 readRegister(DD_ACK); // clear the interrupt flag 00642 } 00643 00644 /* 00645 void attachInterrupt(); 00646 void detachInterrupt(); 00647 */ 00648 00649 /******************************************************************************* 00650 * LOW LEVEL READ AND WRITE REGISTERS 00651 *******************************************************************************/ 00652 00653 // reads a register from the accelerometer 00654 // returns its value or -1 if error 00655 int16_t WaspACC::readRegister(uint8_t regNum) 00656 { 00657 // reset the flag 00658 flag &= ~(ACC_ERROR_READING); 00659 00660 uint8_t aux = 0; 00661 Wire.beginTransmission(i2cID); 00662 Wire.send(regNum); 00663 Wire.endTransmission(); 00664 00665 Wire.requestFrom(i2cID, 1); 00666 if(Wire.available()) 00667 { 00668 aux = Wire.receive(); 00669 return aux; 00670 } 00671 00672 // error, activate the reading flag 00673 flag |= ACC_ERROR_READING; 00674 00675 return -1; 00676 } 00677 00678 // writes a byte to a register in the accelerometer 00679 // returns 0 or -1 if error 00680 int16_t WaspACC::writeRegister(uint8_t address, uint8_t val) 00681 { 00682 // reset the flag 00683 flag &= ~(ACC_ERROR_WRITING); 00684 00685 Wire.beginTransmission(i2cID); 00686 Wire.send(address); 00687 Wire.send(val); 00688 Wire.endTransmission(); 00689 00690 if (readRegister(address) != val) 00691 { 00692 // error, activate the reading flag 00693 flag |= ACC_ERROR_WRITING; 00694 00695 return -1; 00696 } 00697 00698 // exit with no error 00699 return 0; 00700 } 00701 00702 // Private Methods ///////////////////////////////////////////////////////////// 00703 00704 // Preinstantiate Objects ////////////////////////////////////////////////////// 00705 00706 WaspACC ACC = WaspACC(); 00707
1.5.6