1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

pkg/cryptoauthlib: migrate to ztimer

This commit is contained in:
Alexandre Abadie 2021-12-01 14:49:48 +01:00
parent 48fc63e0ae
commit bb5aaa38ad
No known key found for this signature in database
GPG Key ID: 1C919A403CAE1405
2 changed files with 7 additions and 5 deletions

View File

@ -1,4 +1,5 @@
USEMODULE += xtimer
USEMODULE += ztimer
USEMODULE += ztimer_usec
FEATURES_REQUIRED += periph_i2c
FEATURES_OPTIONAL += periph_i2c_reconfigure
DEFAULT_MODULE += auto_init_security

View File

@ -19,7 +19,8 @@
*/
#include <stdio.h>
#include <stdint.h>
#include "xtimer.h"
#include "timex.h"
#include "ztimer.h"
#include "periph/i2c.h"
#include "periph/gpio.h"
@ -29,17 +30,17 @@
/* Timer functions */
void atca_delay_us(uint32_t delay)
{
xtimer_usleep(delay);
ztimer_sleep(ZTIMER_USEC, delay);
}
void atca_delay_10us(uint32_t delay)
{
xtimer_usleep(delay * 10);
ztimer_sleep(ZTIMER_USEC, delay * 10);
}
void atca_delay_ms(uint32_t delay)
{
xtimer_usleep(delay * 1000);
ztimer_sleep(ZTIMER_USEC, delay * US_PER_MS);
}
/* Hal I2C implementation */