テスト用のあれこれ共用フォルダ
Revisão | 179ccef4283415b87dd09c8291e86ee66bbea93b (tree) |
---|---|
Hora | 2018-02-11 06:08:58 |
Autor | takemasa <suikan@user...> |
Commiter | takemasa |
Change the visibility from private to protected, to allow the
inheritance better.
@@ -83,7 +83,7 @@ class Debug | ||
83 | 83 | * Becareful, this is blocking while the Debug::printf() non-blocking. |
84 | 84 | */ |
85 | 85 | char getchFromTask(); |
86 | - private: | |
86 | + protected: | |
87 | 87 | /** |
88 | 88 | * \brief A pointer to the UART class. |
89 | 89 | */ |
@@ -52,7 +52,7 @@ class InterruptSynchronizer | ||
52 | 52 | * Release the task waiting. This member function must be called from the interrupt context. |
53 | 53 | */ |
54 | 54 | void ReleaseTaskFromISR(); |
55 | - private: | |
55 | + protected: | |
56 | 56 | SemaphoreHandle_t semaphore_; |
57 | 57 | }; |
58 | 58 |
@@ -22,6 +22,7 @@ UartLogger::UartLogger(AbstractUart * uart) | ||
22 | 22 | void UartLogger::putMessage(char message[], uint16_t length) |
23 | 23 | { |
24 | 24 | MURASAKI_ASSERT(NULL != message) |
25 | + MURASAKI_ASSERT(isTaskContext()); | |
25 | 26 | uart_->Transmit(reinterpret_cast<uint8_t *>(message), // Message to send |
26 | 27 | length, // length of message by byte. |
27 | 28 | static_cast<WaitMilliSeconds>( PLATFORM_CONFIG_DEBUG_SERIAL_TIMEOUT) // wait eternaly |
@@ -33,6 +34,7 @@ char UartLogger::getCharacter() | ||
33 | 34 | { |
34 | 35 | char buf; |
35 | 36 | |
37 | + MURASAKI_ASSERT(isTaskContext()); | |
36 | 38 | uart_->Receive(reinterpret_cast<uint8_t *>(&buf), // buffer to receive |
37 | 39 | 1, // receive one char |
38 | 40 | (WaitMilliSeconds) PLATFORM_CONFIG_DEBUG_SERIAL_TIMEOUT); // wait forever |
@@ -33,7 +33,7 @@ class UartLogger : public AbstractLogger | ||
33 | 33 | UartLogger(AbstractUart * uart); |
34 | 34 | virtual void putMessage(char message[], uint16_t length); |
35 | 35 | virtual char getCharacter(); |
36 | - private: | |
36 | + protected: | |
37 | 37 | AbstractUart * uart_; |
38 | 38 | }; |
39 | 39 |