File tree Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change 22
22
#include <zephyr/logging/log.h>
23
23
LOG_MODULE_REGISTER (quectel_lcx6g , CONFIG_GNSS_LOG_LEVEL );
24
24
25
- #define QUECTEL_LCX6G_PM_TIMEOUT_MS 500U
25
+ #define QUECTEL_LCX6G_PM_TIMEOUT K_MSEC( 500U)
26
26
#define QUECTEL_LCX6G_SCRIPT_TIMEOUT_S 10U
27
27
28
28
#define QUECTEL_LCX6G_PAIR_NAV_MODE_STATIONARY 4
@@ -74,7 +74,7 @@ struct quectel_lcx6g_data {
74
74
};
75
75
76
76
struct k_sem lock ;
77
- k_timeout_t pm_timeout ;
77
+ k_timepoint_t pm_deadline ;
78
78
};
79
79
80
80
#ifdef CONFIG_PM_DEVICE
@@ -182,18 +182,16 @@ static void quectel_lcx6g_unlock(const struct device *dev)
182
182
static void quectel_lcx6g_pm_changed (const struct device * dev )
183
183
{
184
184
struct quectel_lcx6g_data * data = dev -> data ;
185
- uint32_t pm_ready_at_ms ;
186
185
187
- pm_ready_at_ms = k_uptime_get () + QUECTEL_LCX6G_PM_TIMEOUT_MS ;
188
- data -> pm_timeout = K_TIMEOUT_ABS_MS (pm_ready_at_ms );
186
+ data -> pm_deadline = sys_timepoint_calc (QUECTEL_LCX6G_PM_TIMEOUT );
189
187
}
190
188
191
189
static void quectel_lcx6g_await_pm_ready (const struct device * dev )
192
190
{
193
191
struct quectel_lcx6g_data * data = dev -> data ;
194
192
195
193
LOG_INF ("Waiting until PM ready" );
196
- k_sleep (data -> pm_timeout );
194
+ k_sleep (sys_timepoint_timeout ( data -> pm_deadline ) );
197
195
}
198
196
199
197
static int quectel_lcx6g_resume (const struct device * dev )
You can’t perform that action at this time.
0 commit comments