[Cryptech-Commits] [sw/stm32] 01/02: Merge branch 'ksng' into no-rtos

git at cryptech.is git at cryptech.is
Sun Apr 30 15:34:57 UTC 2017


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

sra at hactrn.net pushed a commit to branch no-rtos
in repository sw/stm32.

commit 2791ee836b2e55076bc109cda19f5b686b6a97d6
Merge: 73b784e 99c8452
Author: Rob Austein <sra at hactrn.net>
AuthorDate: Sun Apr 30 10:37:39 2017 -0400

    Merge branch 'ksng' into no-rtos
    
    Required minor manual intervention to resolve merge issues git had no
    way of understanding: git is clever, but not quite clever enough to
    understand that a commit in branch had removed the entire RTOS that a
    commit in the other branch was using.  No big deal, just a couple of
    osDelay() calls  needing conversion to HAL_Delay() or task_delay().

 projects/bootloader/bootloader.c |   3 +
 projects/cli-test/cli-test.c     |   2 +
 projects/hsm/cryptech_upload     | 190 +++++++++++++++++++++++++++------------
 projects/hsm/hsm.c               |   4 +
 4 files changed, 140 insertions(+), 59 deletions(-)

diff --cc projects/cli-test/cli-test.c
index 17b85cd,397c304..c288257
--- a/projects/cli-test/cli-test.c
+++ b/projects/cli-test/cli-test.c
@@@ -50,6 -50,8 +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); }
++/* Sleep for specified number of seconds -- used after bad PIN. */
++void hal_sleep(const unsigned seconds) { HAL_Delay(seconds * 1000); }
  
  int
  main()
diff --cc projects/hsm/hsm.c
index 60fa2bd,6fcdee4..55c41db
--- a/projects/hsm/hsm.c
+++ b/projects/hsm/hsm.c
@@@ -371,25 -271,12 +371,29 @@@ void hal_critical_section_end(void
  {
      __enable_irq();
  }
 -#endif
  
 -/* The main thread. This does all the setup, and the worker threads handle
 +/* A genericized public interface to task_yield(), for calling from
 + * libhal.
 + */
 +void hal_task_yield(void)
 +{
 +    task_yield();
 +}
 +
 +/* A mutex to arbitrate concurrent access to the keystore.
 + */
 +task_mutex_t ks_mutex = { 0 };
 +void hal_ks_lock(void)   { task_mutex_lock(&ks_mutex); }
 +void hal_ks_unlock(void) { task_mutex_unlock(&ks_mutex); }
 +
++/* Sleep for specified number of seconds.
++ */
++void hal_sleep(const unsigned seconds) { task_delay(seconds * 1000); }
++
 +/* The main task. This does all the setup, and the worker tasks handle
   * the rest.
   */
 -int main()
 +int main(void)
  {
      stm_init();
      uart_set_default(STM_UART_MGMT);



More information about the Commits mailing list