skipper_raspi_uart_test
Dependencies: mbed MPU6050_2 HMC5883L_4 SDFileSystem3
Diff: main.cpp
- Revision:
- 25:1f938342d5f9
- Parent:
- 24:0ad1725c7849
- Child:
- 26:ea86e69563b5
diff -r 0ad1725c7849 -r 1f938342d5f9 main.cpp --- a/main.cpp Mon Feb 18 08:01:23 2019 +0000 +++ b/main.cpp Tue Feb 19 09:52:43 2019 +0000 @@ -80,6 +80,8 @@ Timer t; +FILE *g_fp; + SDFileSystem sd(PB_15, PB_14, PB_13, PB_12, "sd"); RawSerial pc(PA_2,PA_3,115200); //uart2 @@ -148,6 +150,12 @@ pc.printf("Position\r\n"); pc.printf("g_landingcommand=%c\r\n",g_landingcommand); + + g_fp = fopen( "/sd/Datalog01.txt" ,"w+" ); + fprintf(g_fp, "g_landingcommands = %c\r\n",g_landingcommand); + + fclose(g_fp); + NVIC_DisableIRQ(USART1_IRQn); NVIC_DisableIRQ(USART2_IRQn); if(g_landingcommand!='N') MatchPosition(); @@ -537,6 +545,14 @@ Init_sensors(); //switch2.rise(ResetTrim); + g_fp = fopen( "/sd/Datalog01.txt" ,"w+" ); + if( g_fp == NULL ) { + pc.printf( "ファイルオープンエラー\r\n" ); + } + fprintf(g_fp,"Fall Start.\r\n"); + + fclose( g_fp ); + //NVIC_SetPriority(USART1_IRQn,0); //NVIC_SetPriority(EXTI0_IRQn,1); //NVIC_SetPriority(TIM5_IRQn,2);