Using __attribute__((alias("dht_read"))) reduce code size.

This commit is contained in:
vowstar 2015-06-19 01:05:19 +08:00
parent 87341547d7
commit c56659e84d
2 changed files with 8 additions and 20 deletions

View File

@ -188,37 +188,25 @@ int dht_read(uint8_t pin)
// DHTLIB_OK
// DHTLIB_ERROR_CHECKSUM
// DHTLIB_ERROR_TIMEOUT
inline int dht_read21(uint8_t pin)
{
return dht_read(pin);
}
int dht_read21(uint8_t pin) __attribute__((alias("dht_read")));
// return values:
// DHTLIB_OK
// DHTLIB_ERROR_CHECKSUM
// DHTLIB_ERROR_TIMEOUT
inline int dht_read22(uint8_t pin)
{
return dht_read(pin);
}
int dht_read22(uint8_t pin) __attribute__((alias("dht_read")));
// return values:
// DHTLIB_OK
// DHTLIB_ERROR_CHECKSUM
// DHTLIB_ERROR_TIMEOUT
inline int dht_read33(uint8_t pin)
{
return dht_read(pin);
}
int dht_read33(uint8_t pin) __attribute__((alias("dht_read")));
// return values:
// DHTLIB_OK
// DHTLIB_ERROR_CHECKSUM
// DHTLIB_ERROR_TIMEOUT
inline int dht_read44(uint8_t pin)
{
return dht_read(pin);
}
int dht_read44(uint8_t pin) __attribute__((alias("dht_read")));
/////////////////////////////////////////////////////
//

View File

@ -54,10 +54,10 @@ int dht_read_universal(uint8_t pin);
int dht_read11(uint8_t pin);
int dht_read(uint8_t pin);
inline int dht_read21(uint8_t pin);
inline int dht_read22(uint8_t pin);
inline int dht_read33(uint8_t pin);
inline int dht_read44(uint8_t pin);
int dht_read21(uint8_t pin);
int dht_read22(uint8_t pin);
int dht_read33(uint8_t pin);
int dht_read44(uint8_t pin);
double dht_getHumidity(void);
double dht_getTemperature(void);