[Cryptech-Commits] [sw/stm32] branch ksng updated: Add support for hal_sleep().

git at cryptech.is git at cryptech.is
Thu Apr 27 00:16:00 UTC 2017


This is an automated email from the git hooks/post-receive script.

sra at hactrn.net pushed a commit to branch ksng
in repository sw/stm32.

The following commit(s) were added to refs/heads/ksng by this push:
     new 0ced3ff  Add support for hal_sleep().
0ced3ff is described below

commit 0ced3ff3f64ca7ee0fc804d8f6dcfc89d2c5492f
Author: Rob Austein <sra at hactrn.net>
AuthorDate: Wed Apr 26 19:59:24 2017 -0400

    Add support for hal_sleep().
---
 projects/bootloader/bootloader.c | 3 +++
 projects/cli-test/cli-test.c     | 2 ++
 projects/hsm/hsm.c               | 4 ++++
 3 files changed, 9 insertions(+)

diff --git a/projects/bootloader/bootloader.c b/projects/bootloader/bootloader.c
index 3040bd1..683a498 100644
--- a/projects/bootloader/bootloader.c
+++ b/projects/bootloader/bootloader.c
@@ -88,6 +88,9 @@ int should_dfu()
     return 0;
 }
 
+/* Sleep for specified number of seconds -- used after bad PIN. */
+void hal_sleep(const unsigned seconds) { HAL_Delay(seconds * 1000); }
+
 int
 main()
 {
diff --git a/projects/cli-test/cli-test.c b/projects/cli-test/cli-test.c
index 17b85cd..397c304 100644
--- a/projects/cli-test/cli-test.c
+++ b/projects/cli-test/cli-test.c
@@ -50,6 +50,8 @@
 /* MGMT UART interrupt receive buffer (data will be put in a larger ring buffer) */
 volatile uint8_t uart_rx;
 
+/* Delay on bad PINs */
+void hal_sleep(const unsigned seconds) { osDelay(seconds * 1000); }
 
 int
 main()
diff --git a/projects/hsm/hsm.c b/projects/hsm/hsm.c
index f71e2c2..6fcdee4 100644
--- a/projects/hsm/hsm.c
+++ b/projects/hsm/hsm.c
@@ -117,6 +117,10 @@ void hal_ks_lock(void)   { osMutexWait(ks_mutex, osWaitForever); }
 void hal_ks_unlock(void) { osMutexRelease(ks_mutex); }
 #endif
 
+/* Sleep for specified number of seconds.
+ */
+void hal_sleep(const unsigned seconds) { osDelay(seconds * 1000); }
+
 /* A ring buffer for the UART DMA receiver. In theory, it should get at most
  * 92 characters per 1ms tick, but we're going to up-size it for safety.
  */

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Commits mailing list