implement architecture dependent delay functions for esp8266 port
This commit is contained in:
parent
4bf2bf03d7
commit
3a597f1698
|
@ -820,6 +820,28 @@ static void lu8g_digital_write( u8g_t *u8g, uint8_t pin_index, uint8_t value )
|
||||||
platform_gpio_write( pin, value );
|
platform_gpio_write( pin, value );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void u8g_Delay(uint16_t msec)
|
||||||
|
{
|
||||||
|
const uint16_t chunk = 50;
|
||||||
|
|
||||||
|
while (msec > chunk)
|
||||||
|
{
|
||||||
|
os_delay_us( chunk*1000 );
|
||||||
|
msec -= chunk;
|
||||||
|
}
|
||||||
|
if (msec > 0)
|
||||||
|
os_delay_us( msec*1000 );
|
||||||
|
}
|
||||||
|
void u8g_MicroDelay(void)
|
||||||
|
{
|
||||||
|
os_delay_us( 1 );
|
||||||
|
}
|
||||||
|
void u8g_10MicroDelay(void)
|
||||||
|
{
|
||||||
|
os_delay_us( 10 );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
uint8_t u8g_com_esp8266_hw_spi_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_ptr)
|
uint8_t u8g_com_esp8266_hw_spi_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_ptr)
|
||||||
{
|
{
|
||||||
switch(msg)
|
switch(msg)
|
||||||
|
|
|
@ -71,7 +71,7 @@
|
||||||
# define USE_AVR_DELAY
|
# define USE_AVR_DELAY
|
||||||
#elif defined(__18CXX)
|
#elif defined(__18CXX)
|
||||||
# define USE_PIC18_DELAY
|
# define USE_PIC18_DELAY
|
||||||
#elif defined(__arm__)
|
#elif defined(__arm__) || defined(__XTENSA__)
|
||||||
/* do not define anything, all procedures are expected to be defined outside u8glib */
|
/* do not define anything, all procedures are expected to be defined outside u8glib */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Reference in New Issue