Save 80B of flash and 8B of RAM and fix compiler warning:
sketch/adc.c: In function 'adc_init': sketch/adc.c:20:2: warning: implicit declaration of function 'printf' [-Wimplicit-function-declaration] printf(("adc_init\n")); ^ sketch/adc.c:20:2: warning: incompatible implicit declaration of built-in function 'printf' [enabled by default]
This commit is contained in:
parent
02bd319a6c
commit
29d1052f0e
1 changed files with 3 additions and 2 deletions
|
@ -1,8 +1,9 @@
|
||||||
//adc.c
|
//adc.c
|
||||||
|
|
||||||
#include "adc.h"
|
#include "adc.h"
|
||||||
|
#include <stdio.h>
|
||||||
#include <avr/io.h>
|
#include <avr/io.h>
|
||||||
|
#include <avr/pgmspace.h>
|
||||||
|
|
||||||
uint8_t adc_state;
|
uint8_t adc_state;
|
||||||
uint8_t adc_count;
|
uint8_t adc_count;
|
||||||
|
@ -17,7 +18,7 @@ uint16_t adc_sim_mask;
|
||||||
|
|
||||||
void adc_init(void)
|
void adc_init(void)
|
||||||
{
|
{
|
||||||
printf(("adc_init\n"));
|
printf_P(PSTR("adc_init\n"));
|
||||||
adc_sim_mask = 0x00;
|
adc_sim_mask = 0x00;
|
||||||
ADCSRA |= (1 << ADPS2) | (1 << ADPS1) | (1 << ADPS0);
|
ADCSRA |= (1 << ADPS2) | (1 << ADPS1) | (1 << ADPS0);
|
||||||
ADMUX |= (1 << REFS0);
|
ADMUX |= (1 << REFS0);
|
||||||
|
|
Loading…
Reference in a new issue