15,21 → 15,21 |
#define AUTOZERO_DDR DDRD |
#define AUTOZERO_BIT 5 |
|
void gyro_calibrate() { |
void gyro_calibrate(void) { |
// If port not already set to output and high, do it. |
if (!(AUTOZERO_DDR & (1 << AUTOZERO_BIT)) || !(AUTOZERO_PORT & (1 |
<< AUTOZERO_BIT))) { |
AUTOZERO_PORT |= (1 << AUTOZERO_BIT); |
AUTOZERO_DDR |= (1 << AUTOZERO_BIT); |
Delay_ms(100); |
delay_ms(100); |
} |
|
// Make a pulse on the auto-zero output line. |
AUTOZERO_PORT &= ~(1 << AUTOZERO_BIT); |
Delay_ms(1); |
delay_ms(1); |
AUTOZERO_PORT |= (1 << AUTOZERO_BIT); |
// Delay_ms(10); |
Delay_ms_Mess(100); |
delay_ms_Mess(100); |
} |
|
void gyro_setDefaults(void) { |