shared_fooの不要ディレクトリ削除前のもの
Revision | 88d1a4650808569846ef3580cc0ec788a6519c51 (tree) |
---|---|
Time | 2018-03-01 23:47:23 |
Author | takemasa <suikan@user...> |
Commiter | takemasa |
Fixed DebuggFIFO timeout. Make doxygen comment better.
@@ -33,6 +33,7 @@ namespace murasaki { | ||
33 | 33 | * \li \ref PLATFORM_CONFIG_DEBUG_LINE_SIZE |
34 | 34 | * \li \ref PLATFORM_CONFIG_DEBUG_TASK_STACK_SIZE |
35 | 35 | * \li \ref PLATFORM_CONFIG_DEBUG_TASK_PRIORITY |
36 | + * \li @ref PLATFORM_CONFIG_DEBUG_SERIAL_TIMEOUT | |
36 | 37 | * |
37 | 38 | * See \ref MURASAKI_PLATFORM_GROUP as example this class. |
38 | 39 | * |
@@ -55,8 +55,9 @@ unsigned int DebuggerFifo::Get(uint8_t data[], unsigned int size) | ||
55 | 55 | } |
56 | 56 | taskEXIT_CRITICAL(); |
57 | 57 | |
58 | + // wait for the arriaval of the data. | |
58 | 59 | if ( ret_val == 0) |
59 | - sync_->WaitForSignalFromTask(); | |
60 | + sync_->WaitForSignalFromTask(static_cast<murasaki::WaitMilliSeconds>(1000 / portTICK_PERIOD_MS)); | |
60 | 61 | |
61 | 62 | return ret_val; |
62 | 63 |
@@ -1,8 +1,8 @@ | ||
1 | -/* | |
2 | - * debuggerfifo.hpp | |
1 | +/** | |
2 | + * @file debuggerfifo.hpp | |
3 | 3 | * |
4 | - * Created on: 2018/03/01 | |
5 | - * Author: takemasa | |
4 | + * @date 2018/03/01 | |
5 | + * @author takemasa | |
6 | 6 | */ |
7 | 7 | |
8 | 8 | #ifndef DEBUGGERFIFO_HPP_ |
@@ -10,9 +10,30 @@ | ||
10 | 10 | |
11 | 11 | #include <abstractfifo.hpp> |
12 | 12 | #include "synchronizer.hpp" |
13 | +#include "abstractlogger.hpp" | |
13 | 14 | |
14 | 15 | namespace murasaki { |
15 | - | |
16 | +/** | |
17 | + * @defgroup MURASAKI_HELPER_GROUP Helper classes | |
18 | + * @brief Classes to support the murasaki-class. | |
19 | + * @details | |
20 | + * These classess are not used by customer. | |
21 | + * @ingroup MURASAKI_GROUP | |
22 | + */ | |
23 | +/** | |
24 | + * @brief FIFO with thread safe. | |
25 | + * @details | |
26 | + * Non blocking , thread safe FIFO | |
27 | + * | |
28 | + * The Put member function returns with "copied" data count. | |
29 | + * If the internal buffer is full, it returns without copy data. | |
30 | + * This is thread safe and ISR/Task bi-modal. | |
31 | + * | |
32 | + * The Get member funciton returns with "copied" data count and data. | |
33 | + * If the internal buffer is empty, it returns without copy data. | |
34 | + * | |
35 | + * @ingroup MURASAKI_HELPER_GROUP | |
36 | + */ | |
16 | 37 | class DebuggerFifo : public AbstractFifo |
17 | 38 | { |
18 | 39 | public: |
@@ -28,29 +49,41 @@ class DebuggerFifo : public AbstractFifo | ||
28 | 49 | */ |
29 | 50 | virtual ~DebuggerFifo(); |
30 | 51 | /** |
31 | - * @brief Put the data into the internal buffer. | |
52 | + * @brief Put the data into the internal buffer.This is thread safe. Task/ISR bimodal. | |
32 | 53 | * @param data Data to be copied to the internal buffer |
33 | 54 | * @param size Data count to be copied |
34 | 55 | * @return The count of copied data. 0, if the internal buffer is full. |
35 | 56 | */ |
36 | 57 | virtual unsigned int Put(uint8_t const data[], unsigned int size); |
37 | 58 | /** |
38 | - * @brief Get the data from the internal buffer. | |
59 | + * @brief Get the data from the internal buffer. This is thread safe function. Do not call from ISR. | |
39 | 60 | * @param data Data buffer to receive from the internal buffer |
40 | 61 | * @param size Size of the data parameter. |
41 | 62 | * @return The count of copied data. 0, if the internal buffer is empty |
42 | 63 | */ |
43 | 64 | virtual unsigned int Get(uint8_t data[], unsigned int size); |
44 | - /* | |
45 | - * @brief Mark all the data inside the internal buffer as "not sent". | |
65 | + /** | |
66 | + * @brief Mark all the data inside the internal buffer as "not sent". Thread safe. | |
46 | 67 | */ |
47 | 68 | virtual void ReWind(); |
48 | 69 | private: |
70 | + // Alias to call the parent member function. | |
49 | 71 | typedef AbstractFifo inherited; |
72 | + // For the communication between generator / consumer. | |
50 | 73 | Synchronizer * const sync_; |
51 | 74 | |
52 | 75 | }; |
53 | 76 | |
77 | +/** | |
78 | + * @brief A stracture to engroup the logging tools. | |
79 | + * @ingroup MURASAKI_HELPER_GROUP | |
80 | + */ | |
81 | +struct LoggingHelpers | |
82 | +{ | |
83 | + AbstractFifo * fifo; | |
84 | + AbstractLogger * logger; | |
85 | + ; | |
86 | + | |
54 | 87 | } /* namespace murasaki */ |
55 | 88 | |
56 | 89 | #endif /* DEBUGGERFIFO_HPP_ */ |