テスト用のあれこれ共用フォルダ
Revision | 949e6a26a899f672406dd03f6ca7ae00cad462ce (tree) |
---|---|
Time | 2018-04-30 13:52:16 |
Author | takemasa <suikan@user...> |
Commiter | takemasa |
Sending message from UART1
@@ -63,15 +63,18 @@ void DoTestUart(void) | ||
63 | 63 | |
64 | 64 | func_ptr const func = reinterpret_cast<func_ptr>(1); |
65 | 65 | |
66 | -// MURASAKI_ASSERT(counter % 2 == 0, "Odd counter"); | |
67 | - // by murasaki debugging output. You can use this in both task and interrupt context. | |
68 | - // non blocking | |
69 | 66 | |
70 | 67 | murasaki::debugger->Printf("Count %4d \r\n", count); |
71 | 68 | #if 0 |
69 | + MURASAKI_ASSERT(false) | |
72 | 70 | func(); |
73 | 71 | #endif |
74 | 72 | count++; |
73 | + | |
74 | + // Testing device | |
75 | + murasaki::platform.uart1->Transmit( | |
76 | + reinterpret_cast<uint8_t *>(const_cast<char *>("Hello")), 5); | |
77 | + | |
75 | 78 | } |
76 | 79 | |
77 | 80 | // Hook for the assert_failure() in main.c |
@@ -109,6 +112,24 @@ void HAL_UART_RxCpltCallback(UART_HandleTypeDef * huart) | ||
109 | 112 | |
110 | 113 | } |
111 | 114 | |
115 | +void HAL_SPI_TxRxCpltCallback(SPI_HandleTypeDef * hspi) { | |
116 | + if (murasaki::platform.spi1_master->TransmitAndReceiveCompleteCallback( | |
117 | + hspi)) | |
118 | + return; | |
119 | +} | |
120 | + | |
121 | + | |
122 | +void HAL_I2C_TxCpltCallback(I2C_HandleTypeDef * hi2c) { | |
123 | + | |
124 | + if (murasaki::platform.i2c1_master->TransmitCompleteCallback(hi2c)) | |
125 | + return; | |
126 | +} | |
127 | + | |
128 | +void HAL_I2C_RxCpltCallback(I2C_HandleTypeDef * hi2c) { | |
129 | + | |
130 | + if (murasaki::platform.i2c1_master->ReceiveCompleteCallback(hi2c)) | |
131 | + return; | |
132 | +} | |
112 | 133 | |
113 | 134 | void CustomDefaultHandler() |
114 | 135 | { |