unix, stmhal: Introduce mp_hal_delay_ms(), mp_hal_ticks_ms().

These MPHAL functions are intended to replace previously used HAL_Delay(),
HAL_GetTick() to provide better naming and MPHAL separation (they are
fully equivalent otherwise).

Also, refactor extmod/modlwip to use them.
This commit is contained in:
Paul Sokolovsky
2015-10-27 23:31:42 +03:00
parent 9011815d86
commit 404dae80a9
5 changed files with 20 additions and 16 deletions

View File

@@ -1,6 +1,10 @@
#ifndef __LWIPOPTS_H__
#define __LWIPOPTS_H__
#include <py/mpconfig.h>
#include <py/misc.h>
#include MICROPY_HAL_H
// We're running without an OS for this port. We don't provide any services except light protection.
#define NO_SYS 1
@@ -26,7 +30,7 @@ typedef uint32_t sys_prot_t;
// For now, we can simply define this as a macro for the timer code. But this function isn't
// universal and other ports will need to do something else. It may be necessary to move
// things like this into a port-provided header file.
#define sys_now HAL_GetTick
#define sys_now mp_hal_ticks_ms
#endif