同時通信確認版

Dependencies:   mbed mbed

Fork of Scarlet_relay_V4 by 航空研究会

Committer:
taknokolat
Date:
Tue Sep 18 02:20:23 2018 +0000
Revision:
2:f975d9cb584d
Parent:
1:e257c3c3f659
Child:
3:92c039aed84a
a

Who changed what in which revision?

UserRevisionLine numberNew contents of line
TUATBM 0:1f2bac0f6ab8 1 #include "mbed.h"
taknokolat 2:f975d9cb584d 2 //#include "Serial.h"
TUATBM 1:e257c3c3f659 3
taknokolat 2:f975d9cb584d 4 RawSerial pc(PA_2,PA_3,57600);
taknokolat 2:f975d9cb584d 5 //RawSerial uart1(PB_6,PB_7,57600);
TUATBM 1:e257c3c3f659 6 //Serial MySerial1(PA_2,PA_3);
TUATBM 0:1f2bac0f6ab8 7
TUATBM 1:e257c3c3f659 8
TUATBM 1:e257c3c3f659 9
TUATBM 1:e257c3c3f659 10
TUATBM 0:1f2bac0f6ab8 11
TUATBM 0:1f2bac0f6ab8 12 void ISR_Serial_Rx()
TUATBM 0:1f2bac0f6ab8 13 {
TUATBM 1:e257c3c3f659 14
TUATBM 1:e257c3c3f659 15
TUATBM 0:1f2bac0f6ab8 16 // シリアルの受信処理
TUATBM 1:e257c3c3f659 17
taknokolat 2:f975d9cb584d 18 char data=pc.getc();
TUATBM 1:e257c3c3f659 19
TUATBM 1:e257c3c3f659 20
TUATBM 1:e257c3c3f659 21
TUATBM 1:e257c3c3f659 22
TUATBM 1:e257c3c3f659 23 // メイン処理
taknokolat 2:f975d9cb584d 24 pc.printf("%c",data);
TUATBM 1:e257c3c3f659 25
TUATBM 1:e257c3c3f659 26
TUATBM 0:1f2bac0f6ab8 27
TUATBM 0:1f2bac0f6ab8 28
TUATBM 0:1f2bac0f6ab8 29 }
TUATBM 0:1f2bac0f6ab8 30
TUATBM 0:1f2bac0f6ab8 31 int main()
TUATBM 0:1f2bac0f6ab8 32 {
TUATBM 0:1f2bac0f6ab8 33
TUATBM 0:1f2bac0f6ab8 34 // シリアル通信受信の割り込みイベント登録
taknokolat 2:f975d9cb584d 35 pc.attach(ISR_Serial_Rx, Serial::RxIrq);
TUATBM 0:1f2bac0f6ab8 36
TUATBM 0:1f2bac0f6ab8 37 while (1) {
TUATBM 0:1f2bac0f6ab8 38 // メイン処理
taknokolat 2:f975d9cb584d 39 //NVIC_DisableIRQ(USART2_IRQn);
taknokolat 2:f975d9cb584d 40 //usbSerial.printf("TUAT\r\n");
taknokolat 2:f975d9cb584d 41 //NVIC_EnableIRQ(USART2_IRQn);
taknokolat 2:f975d9cb584d 42 // wait(1.0);
TUATBM 0:1f2bac0f6ab8 43
TUATBM 0:1f2bac0f6ab8 44 }
TUATBM 0:1f2bac0f6ab8 45
TUATBM 0:1f2bac0f6ab8 46 }