implement architecture dependent delay functions for esp8266 port

This commit is contained in:
devsaurus 2016-01-12 23:29:57 +01:00
parent 4bf2bf03d7
commit 3a597f1698
2 changed files with 23 additions and 1 deletions

View File

@ -820,6 +820,28 @@ static void lu8g_digital_write( u8g_t *u8g, uint8_t pin_index, uint8_t 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)
{
switch(msg)

View File

@ -71,7 +71,7 @@
# define USE_AVR_DELAY
#elif defined(__18CXX)
# 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 */
/*