• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
Keine Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

shared_fooの不要ディレクトリ削除前のもの


Commit MetaInfo

Revision265c720a5207703017b1443165526582b7edf16b (tree)
Zeit2018-03-03 09:29:59
Autortakemasa <suikan@user...>
Commitertakemasa

Log Message

Debugger FIFO tested.

Ändern Zusammenfassung

Diff

--- a/stm32_development/murasaki/Src/main.c
+++ b/stm32_development/murasaki/Src/main.c
@@ -5,41 +5,41 @@
55 ******************************************************************************
66 * This notice applies to any and all portions of this file
77 * that are not between comment pairs USER CODE BEGIN and
8- * USER CODE END. Other portions of this file, whether
8+ * USER CODE END. Other portions of this file, whether
99 * inserted by the user or by software development tools
1010 * are owned by their respective copyright owners.
1111 *
12- * Copyright (c) 2018 STMicroelectronics International N.V.
12+ * Copyright (c) 2018 STMicroelectronics International N.V.
1313 * All rights reserved.
1414 *
15- * Redistribution and use in source and binary forms, with or without
15+ * Redistribution and use in source and binary forms, with or without
1616 * modification, are permitted, provided that the following conditions are met:
1717 *
18- * 1. Redistribution of source code must retain the above copyright notice,
18+ * 1. Redistribution of source code must retain the above copyright notice,
1919 * this list of conditions and the following disclaimer.
2020 * 2. Redistributions in binary form must reproduce the above copyright notice,
2121 * this list of conditions and the following disclaimer in the documentation
2222 * and/or other materials provided with the distribution.
23- * 3. Neither the name of STMicroelectronics nor the names of other
24- * contributors to this software may be used to endorse or promote products
23+ * 3. Neither the name of STMicroelectronics nor the names of other
24+ * contributors to this software may be used to endorse or promote products
2525 * derived from this software without specific written permission.
26- * 4. This software, including modifications and/or derivative works of this
26+ * 4. This software, including modifications and/or derivative works of this
2727 * software, must execute solely and exclusively on microcontroller or
2828 * microprocessor devices manufactured by or for STMicroelectronics.
29- * 5. Redistribution and use of this software other than as permitted under
30- * this license is void and will automatically terminate your rights under
31- * this license.
29+ * 5. Redistribution and use of this software other than as permitted under
30+ * this license is void and will automatically terminate your rights under
31+ * this license.
3232 *
33- * THIS SOFTWARE IS PROVIDED BY STMICROELECTRONICS AND CONTRIBUTORS "AS IS"
34- * AND ANY EXPRESS, IMPLIED OR STATUTORY WARRANTIES, INCLUDING, BUT NOT
35- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
33+ * THIS SOFTWARE IS PROVIDED BY STMICROELECTRONICS AND CONTRIBUTORS "AS IS"
34+ * AND ANY EXPRESS, IMPLIED OR STATUTORY WARRANTIES, INCLUDING, BUT NOT
35+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
3636 * PARTICULAR PURPOSE AND NON-INFRINGEMENT OF THIRD PARTY INTELLECTUAL PROPERTY
37- * RIGHTS ARE DISCLAIMED TO THE FULLEST EXTENT PERMITTED BY LAW. IN NO EVENT
37+ * RIGHTS ARE DISCLAIMED TO THE FULLEST EXTENT PERMITTED BY LAW. IN NO EVENT
3838 * SHALL STMICROELECTRONICS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
3939 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
40- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
41- * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
42- * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
40+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
41+ * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
42+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
4343 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
4444 * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
4545 *
@@ -151,11 +151,11 @@ int main(void)
151151 /* USER CODE BEGIN RTOS_QUEUES */
152152 /* add queues, ... */
153153 /* USER CODE END RTOS_QUEUES */
154-
154+
155155
156156 /* Start scheduler */
157157 osKernelStart();
158-
158+
159159 /* We should never get here as control is now taken by the scheduler */
160160
161161 /* Infinite loop */
@@ -180,13 +180,13 @@ void SystemClock_Config(void)
180180 RCC_ClkInitTypeDef RCC_ClkInitStruct;
181181 RCC_PeriphCLKInitTypeDef PeriphClkInitStruct;
182182
183- /**Configure the main internal regulator output voltage
183+ /**Configure the main internal regulator output voltage
184184 */
185185 __HAL_RCC_PWR_CLK_ENABLE();
186186
187187 __HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE3);
188188
189- /**Initializes the CPU, AHB and APB busses clocks
189+ /**Initializes the CPU, AHB and APB busses clocks
190190 */
191191 RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI;
192192 RCC_OscInitStruct.HSIState = RCC_HSI_ON;
@@ -197,7 +197,7 @@ void SystemClock_Config(void)
197197 _Error_Handler(__FILE__, __LINE__);
198198 }
199199
200- /**Initializes the CPU, AHB and APB busses clocks
200+ /**Initializes the CPU, AHB and APB busses clocks
201201 */
202202 RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK|RCC_CLOCKTYPE_SYSCLK
203203 |RCC_CLOCKTYPE_PCLK1|RCC_CLOCKTYPE_PCLK2;
@@ -218,11 +218,11 @@ void SystemClock_Config(void)
218218 _Error_Handler(__FILE__, __LINE__);
219219 }
220220
221- /**Configure the Systick interrupt time
221+ /**Configure the Systick interrupt time
222222 */
223223 HAL_SYSTICK_Config(HAL_RCC_GetHCLKFreq()/1000);
224224
225- /**Configure the Systick
225+ /**Configure the Systick
226226 */
227227 HAL_SYSTICK_CLKSourceConfig(SYSTICK_CLKSOURCE_HCLK);
228228
@@ -277,10 +277,10 @@ static void MX_USART3_UART_Init(void)
277277
278278 }
279279
280-/**
280+/**
281281 * Enable DMA controller clock
282282 */
283-static void MX_DMA_Init(void)
283+static void MX_DMA_Init(void)
284284 {
285285 /* DMA controller clock enable */
286286 __HAL_RCC_DMA1_CLK_ENABLE();
@@ -302,9 +302,9 @@ static void MX_DMA_Init(void)
302302
303303 }
304304
305-/** Configure pins as
306- * Analog
307- * Input
305+/** Configure pins as
306+ * Analog
307+ * Input
308308 * Output
309309 * EVENT_OUT
310310 * EXTI
@@ -463,9 +463,9 @@ void StartDefaultTask(void const * argument)
463463 for(;;)
464464 {
465465 DoTestUart();
466- osDelay(1000);
466+ osDelay(500);
467467 }
468- /* USER CODE END 5 */
468+ /* USER CODE END 5 */
469469 }
470470
471471 /**
@@ -501,7 +501,7 @@ void _Error_Handler(char * file, int line)
501501 while(1)
502502 {
503503 }
504- /* USER CODE END Error_Handler_Debug */
504+ /* USER CODE END Error_Handler_Debug */
505505 }
506506
507507 #ifdef USE_FULL_ASSERT
@@ -527,10 +527,10 @@ void assert_failed(uint8_t* file, uint32_t line)
527527
528528 /**
529529 * @}
530- */
530+ */
531531
532532 /**
533533 * @}
534-*/
534+*/
535535
536536 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
--- a/stm32_development/murasaki/Src/my_test.cpp
+++ b/stm32_development/murasaki/Src/my_test.cpp
@@ -11,6 +11,8 @@
1111 #include "main.h"
1212 #include "stm32f7xx_hal.h"
1313
14+// Test for debuggerfifo
15+#include "debuggerfifo.hpp"
1416
1517 #define DEBUGGER_OUT true
1618
@@ -22,7 +24,7 @@ murasaki::Debugger * murasaki::debugger;
2224 #define MSG1 "A quick brown fox jumps over the lazy dog."
2325
2426 static int counter;
25-static murasaki::AbstractFifo * test_fifo;
27+static murasaki::DebuggerFifo * test_fifo;
2628
2729 // Initialize the platfrom variables. This have to be doen before
2830 // using other murasaki funciton.
@@ -58,7 +60,7 @@ void InitTestUart(UART_HandleTypeDef * uart_handle, SPI_HandleTypeDef * spi_hand
5860 murasaki::debugger = new murasaki::Debugger(murasaki::platform.logger);
5961 murasaki::debugger->AutoHistory(); // type any key to show history.
6062
61- test_fifo = new murasaki::AbstractFifo(32);
63+ test_fifo = new murasaki::DebuggerFifo(32);
6264 MURASAKI_ASSERT(test_fifo != nullptr);
6365
6466 unsigned int copied = test_fifo->Put(reinterpret_cast<const uint8_t *>(MSG1), sizeof(MSG1));
@@ -79,7 +81,8 @@ void DoTestUart(void)
7981 if (copied == 0)
8082 {
8183 murasaki::debugger->printf("FIFO.Get(), %d data taransfered \n\r", copied);
82- test_fifo->ReWind();
84+// test_fifo->ReWind();
85+ test_fifo->NotifyData();
8386 }
8487 else {
8588 murasaki::debugger->printf("FIFO.Get(), %d data taransfered : '%10s'\n\r", copied, data);