From 3e884d678b5bd2871452bdfb81be3d9ea4fa4431 Mon Sep 17 00:00:00 2001
From: Daniel Friesel <derf@finalrewind.org>
Date: Thu, 25 Oct 2018 14:23:44 +0200
Subject: [PATCH] =?UTF-8?q?msp430:=20Fix=20delay=5Fus/delay=5Fms=20for=20F?=
 =?UTF-8?q?=5FCPU=E2=89=A016MHz?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 src/arch/msp430fr5969lp/arch.cc | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/arch/msp430fr5969lp/arch.cc b/src/arch/msp430fr5969lp/arch.cc
index b3cfbf6..cde0503 100644
--- a/src/arch/msp430fr5969lp/arch.cc
+++ b/src/arch/msp430fr5969lp/arch.cc
@@ -105,13 +105,13 @@ volatile char run_loop = 0;
 void Arch::delay_us(unsigned int const us)
 {
 	for (unsigned int i = 0; i < us/10; i++) {
-		__delay_cycles(160);
+		__delay_cycles(F_CPU / 100000UL);
 	}
 }
 void Arch::delay_ms(unsigned int const ms)
 {
 	for (unsigned int i = 0; i < ms; i++) {
-		__delay_cycles(16000);
+		__delay_cycles(F_CPU / 1000UL);
 	}
 }
 
-- 
GitLab