割り込みテスト用(28は間違い)
Dependencies: HCSR04_2 MPU6050_2 mbed SDFileSystem3
Fork of Autoflight2018_27_test by
Revision 24:3e7dcf16a6a7, committed 2018-09-20
- Comitter:
- taknokolat
- Date:
- Thu Sep 20 07:12:24 2018 +0000
- Parent:
- 23:0f3b1441b08c
- Commit message:
- a
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
diff -r 0f3b1441b08c -r 3e7dcf16a6a7 main.cpp --- a/main.cpp Thu Sep 20 04:20:19 2018 +0000 +++ b/main.cpp Thu Sep 20 07:12:24 2018 +0000 @@ -334,8 +334,8 @@ NVIC_SetPriority(USART1_IRQn,0); NVIC_SetPriority(EXTI0_IRQn,1); - NVIC_SetPriority(TIM5_IRQn,3); - NVIC_SetPriority(EXTI9_5_IRQn,4); + NVIC_SetPriority(TIM5_IRQn,2); + NVIC_SetPriority(EXTI9_5_IRQn,3); DisplayClock(); t.start(); @@ -354,7 +354,7 @@ } pc.attach(getSF_Serial, Serial::RxIrq); - NVIC_SetPriority(USART2_IRQn,2); + NVIC_SetPriority(USART2_IRQn,4); FirstROLL = nowAngle[ROLL]; FirstPITCH = nowAngle[PITCH]; @@ -388,7 +388,16 @@ NVIC_EnableIRQ(USART1_IRQn); NVIC_EnableIRQ(USART2_IRQn); pc.printf("5\r\n"); + + NVIC_SetPriority(TIM5_IRQn,4); + NVIC_SetPriority(USART2_IRQn,2); + wait_ms(23); + + NVIC_SetPriority(TIM5_IRQn,2); + NVIC_SetPriority(USART2_IRQn,4); + + pc.printf("6\r\n"); //NVIC_DisableIRQ(USART2_IRQn); //pc.printf("%c",g_landingcommand); @@ -1043,7 +1052,7 @@ void getSF_Serial(){ NVIC_DisableIRQ(USART1_IRQn); NVIC_DisableIRQ(EXTI0_IRQn); - NVIC_DisableIRQ(TIM5_IRQn); + //NVIC_DisableIRQ(TIM5_IRQn); static char SFbuf[16]; static int bufcounter=0; @@ -1069,9 +1078,9 @@ pc.printf("Communication Falsed.\r\n"); bufcounter = 0; } - NVIC_EnableIRQ(TIM5_IRQn); + //NVIC_EnableIRQ(TIM5_IRQn); NVIC_EnableIRQ(EXTI0_IRQn); - NVIC_EnableIRQ(USART1_IRQn); + NVIC_EnableIRQ(USART1_IRQn); } float ConvertByteintoFloat(char high, char low){