From 43d9c0fbb4e8dbec1d8676b4b98d6fa36a86c1fa Mon Sep 17 00:00:00 2001 From: Ahmet Alincak Date: Mon, 7 Jun 2021 00:38:36 +0300 Subject: [PATCH] Gate ticker (timer0) clock on deepsleep --- targets/TARGET_Maxim/TARGET_MAX32620C/sleep.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/targets/TARGET_Maxim/TARGET_MAX32620C/sleep.c b/targets/TARGET_Maxim/TARGET_MAX32620C/sleep.c index 7907bd0f948..28b48e3129a 100644 --- a/targets/TARGET_Maxim/TARGET_MAX32620C/sleep.c +++ b/targets/TARGET_Maxim/TARGET_MAX32620C/sleep.c @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (C) 2017 Maxim Integrated Products, Inc., All Rights Reserved. + * Copyright (C) Maxim Integrated Products, Inc., All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -33,6 +33,7 @@ #include "sleep_api.h" #include "lp.h" +#include "clkman.h" void hal_sleep(void) { @@ -42,5 +43,7 @@ void hal_sleep(void) // Low-power stop mode void hal_deepsleep(void) { + MXC_CLKMAN->clk_gate_ctrl1 &= ~MXC_F_CLKMAN_CLK_GATE_CTRL1_TIMER0_CLK_GATER; hal_sleep(); + MXC_CLKMAN->clk_gate_ctrl1 |= MXC_F_CLKMAN_CLK_GATE_CTRL1_TIMER0_CLK_GATER; }