Commit b7962c7718e05545d26f836a5c595f5ef97cbae8

  • avatar
  • dcoberii
  • Fri Apr 24 06:25:46 CEST 2009
Fixed configAccel to be more general
  
1111
1212 void initAccel(); //call with other inits
1313 void updateAccel(); //call with other updates
14 void configAccel(fantasia_pkt_t *pkt); //give this all valid config packets, sets up triggers and timing, if it gets a mode==POLL then it sends a data packet to the xBee
14 void configAccel(accel_config_t *config); //give this all valid config packets, sets up triggers and timing, if it gets a mode==POLL then it sends a data packet to the xBee
1515 //void pollAccel(); //depreciated, gave direct access to the data, instead it is just called internally and the packet is sent in accel.pde
1616
1717#endif
  
113113}
114114
115115//Accelerometer config
116//ARGS: just pass us the packet address:
117void configAccel(fantasia_pkt_t *pkt){
116//ARGS: just pass us the accel_config packet data address:
117void configAccel(accel_config_t *config){
118118
119 mode = pkt->accel_config.mode;
119 mode = config->mode;
120120
121 switch( pkt->accel_config.mode){
121 switch( config->mode){
122122 case TRIGGER:
123 trigger = (pkt->accel_config.data)<<12;
123 trigger = (config->data)<<12;
124124 break;
125125 case TIMER:
126 timer_period = pkt->accel_config.data;
126 timer_period = config->data;
127127 timer_target = millis() + timer_period;
128128 break;
129129 case POLL: