diff --git a/AUTHORS b/AUTHORS index 9aceb6b..c347954 100644 --- a/AUTHORS +++ b/AUTHORS @@ -48,6 +48,7 @@ NIIBE Yutaka: Under contract of g10 Code GmbH, wrote: mcu/usb-usbip.c + contrib/usart-stm32f103.c Paul Fertser: Added Blue Pill support. diff --git a/ChangeLog b/ChangeLog index f0087f9..7e4365c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2017-12-19 NIIBE Yutaka + + * VERSION: 1.7. + * doc/chopstx.texi (VERSION): 1.7. + 2017-12-18 NIIBE Yutaka * contrib/usart-stm32f103.c: New. @@ -14,7 +19,7 @@ * mcu/sys-stm32f103.h (BOARD_ID_FST_01G): New. - * contrib/adc-stm32f103.c (get_adc_config): Add case for + * contrib/adc-stm32f103.c (get_adc_config): Add a case for BOARD_ID_FST_01G and BOARD_ID_ST_NUCLEO_F103. 2017-11-24 NIIBE Yutaka diff --git a/NEWS b/NEWS index fc95231..a8ac9c0 100644 --- a/NEWS +++ b/NEWS @@ -3,12 +3,12 @@ NEWS - Noteworthy changes * Major changes in Chopstx 1.7 - Released 2017-12-XX + Released 2017-12-19 ** Fix: timer wakeup Timer expiration had a bug. When it is waken up, the wake up doesn't -handle as timer expiration when there are multiple threads on same -wake up timing. +handle as a timer expiration when there are multiple threads on same +timing of expire. It confuses as if it were forced wakeup. ** New driver: USART for STM32. USART driver for STM32 is added. diff --git a/README b/README index b864f05..a947a11 100644 --- a/README +++ b/README @@ -1,6 +1,6 @@ Chopstx - Threads and only Threads Version 1.7 - 2017-12-XX + 2017-12-19 Niibe Yutaka Flying Stone Technology @@ -17,6 +17,11 @@ stacks, Chopstx just offers a simple RT thread library. With Chopstx, interrupt handling is also done by a thread. This enables coherent code for ease of maintenance. +While threads are important, we don't need more threads than +necessary. Chopstx provides a feature of poll, so that we can +minimize use of threads. + + Note that this library is _not_ related to the hand game: https://en.wikipedia.org/wiki/Chopsticks_(hand_game) diff --git a/VERSION b/VERSION index eaec816..6c0174d 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -release/1.6 +release/1.7 diff --git a/chopstx-cortex-m.c b/chopstx-cortex-m.c index 28f1d3c..8293cde 100644 --- a/chopstx-cortex-m.c +++ b/chopstx-cortex-m.c @@ -287,7 +287,7 @@ chx_request_preemption (uint16_t prio) * * Returns: * 1 on wakeup by others. - * 0 on normal wakeup (timer expiration, getting lock). + * 0 on normal wakeup (timer expiration, lock aquirement). * -1 on cancellation. */ static uintptr_t __attribute__ ((naked, noinline)) diff --git a/contrib/usart-stm32f103.c b/contrib/usart-stm32f103.c index 2d234d6..2551260 100644 --- a/contrib/usart-stm32f103.c +++ b/contrib/usart-stm32f103.c @@ -617,7 +617,7 @@ usart_send_break (uint8_t dev_no) return -1; if ((USARTx->CR1 & 0x01)) - return 1; /* Busy sending break, which was requested before. */ + return 1; /* Busy sending break, which was requested before. */ USARTx->CR1 |= 0x01; return 0; diff --git a/doc/chopstx.texi b/doc/chopstx.texi index 7e6994e..526ae6a 100644 --- a/doc/chopstx.texi +++ b/doc/chopstx.texi @@ -1,7 +1,7 @@ \input texinfo @c -*-texinfo-*- @c %**start of header @setfilename chopstx.info -@set VERSION 1.6 +@set VERSION 1.7 @settitle Chopstx Reference Manual @c Unify some of the indices. @syncodeindex tp fn @@ -60,7 +60,8 @@ section entitled ``Copying''. @menu * Introduction:: What is Chopstx. * Threads and only Threads:: Threads and only Threads. -* Note: Use of sleep mode:: Use it carefully. +* Poll or Pole:: Poll or Pole. +* Note (Use of sleep mode):: Use it carefully. * API:: API. Appendix @@ -90,11 +91,16 @@ Cortex-M3 and GNU/Linux emulation. Specifically, it is used for STM32F030, MKL27Z, STM32F103 and as a command on GNU/Linux. While most RTOSes come with many features, drivers, and stacks, -Chopstx just offers a RT thread library. +Chopstx just offers an RT thread library. With Chopstx, interrupt handling is also done by a thread. This enables coherent code for ease of maintenance. +While threads are important, we don't need more threads than +necessary. Chopstx provides a feature of poll, so that we can +minimize use of threads. + + @node Threads and only Threads @chapter Threads and only Threads @@ -129,8 +135,17 @@ support more performance (frequency). In general, such an example is best suited by hardware (not software). -@node Note: Use of sleep mode -@chapter Note: Use of sleep mode +@node Poll or Pole +@chapter Poll or Pole +Chopstx provides the @code{chopstx_poll} function to wait on multiple events. + +Using @code{chopstx_poll}, we can write an application by event-driven +programming style, with minimum number of threads, avoiding +complicated dependency between threads. + + +@node Note (Use of sleep mode) +@chapter Note (Use of sleep mode) Calling the chopstx_conf_idle function (> 0) to allow the idle thread going to sleep. MCU will be in sleep mode when no threads are