void init_MMA7660FC(void)
{
  int x, y, z;
  unsigned char val = 0;
  bt_accelInitFlag = 1;
  if(!eei2cLockFlag)
  {
    leds(0b111111);
    eei2cLock = locknew();
    lockclr(eei2cLock);
    eei2cLockFlag = 1;
  }
  if(!st_eeInitFlag) ee_init();
  while(lockset(eei2cLock));  
  i2c_out(st_eeprom, MMA7660_I2C, 
          MODE, 1, &val, 1);
  i2c_out(st_eeprom, MMA7660_I2C, 
          INTSU, 1, &val, 1);
  i2c_out(st_eeprom, MMA7660_I2C, 
          SR, 1, &val, 1);
  val = 0xC1;
  i2c_out(st_eeprom, MMA7660_I2C, 
          MODE, 1, &val, 1);
  i2c_stop(st_eeprom);        
  lockclr(eei2cLock);
  accels(&x, &y, &z);        
}
Exemplo n.º 2
0
wxAcceleratorTable *wxMenu::CreateAccelTable() const
{
    const size_t count = m_accels.size();
    wxScopedArray<wxAcceleratorEntry> accels(new wxAcceleratorEntry[count]);
    CopyAccels(accels.get());

    return new wxAcceleratorTable(count, accels.get());
}