Пример #1
0
void speaker_playShoot(void) {
    count = 0;
    period = SPEAKER_SHOOT_PERIOD;
    speaker_pause();
    speaker_setPeriod(SPEAKER_SHOOT_PERIOD);
    speaker_attachInterrupt(SPEAKER_CHANNEL, speaker_shoot);
    speaker_refresh();
    speaker_resume();
}
Пример #2
0
void speaker_playHit(void){

    gps_disableInterrupt();

    speaker_count = 0;
    speaker_period = SPEAKER_HIT_PERIOD;
    speaker_pause();
    speaker_setPeriod(SPEAKER_HIT_PERIOD);
    speaker_attachInterrupt(SPEAKER_CHANNEL, speaker_hit);
    speaker_refresh();
    speaker_resume();
}
Пример #3
0
void speaker_shoot(void) {
    count++;
    speaker_toggle();
    if(count > MAX_COUNT_SHOOT) {
        speaker_pause();
        speaker_detachInterrupt(SPEAKER_CHANNEL);
        gpio_write_bit(SPEAKER_PORT, SPEAKER_PIN, 0);
    } else if( count % SPEAKER_SHOOT_MOD == 0 ) {
        period += SPEAKER_SHOOT_INCREASE;
        speaker_setPeriod(period);
        speaker_refresh();
    }
}
Пример #4
0
void speaker_hit(void){
    speaker_count++;
    speaker_toggle();
    if(speaker_count >= MAX_COUNT_HIT){
        speaker_pause();
        speaker_detachInterrupt(SPEAKER_CHANNEL);
        gpio_write_bit(SPEAKER_PORT, SPEAKER_PIN, 0);

        gps_enableInterrupt();

    } else if( speaker_count % SPEAKER_HIT_MOD == 0 ){
        speaker_period += SPEAKER_HIT_INCREASE;
        speaker_setPeriod(speaker_period);
        speaker_refresh();
    }
}