Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of MainBoard2018_Auto_Master_A_new by
Communication/RS485/RS485.cpp
- Committer:
- kishibekairohan
- Date:
- 2018-10-21
- Revision:
- 14:dfcec98f5aa9
- Parent:
- 0:669ef71cba68
File content as of revision 14:dfcec98f5aa9:
#include "RS485.h" #include "mbed.h" #include "ActuatorHub/ActuatorHub.h" #include "../../LED/LED.h" #include "../../System/Using.h" namespace RS485 { DigitalOut selectBit(SELECTBIT_PIN); Serial RS485Uart(RS485UART_TX, RS485UART_RX); void Transmit(); void RS485::Initialize() { selectBit = 1; //送信固定 RS485Uart.baud(38400); RS485Uart.attach(Transmit, Serial::TxIrq); } void Transmit() { static uint8_t count = 0; __disable_irq(); RS485Uart.putc(RS485SendBuffer.GetData()); if(count >= 200) { #ifdef USE_MOTOR LED_DEBUG2 = !LED_DEBUG2; #endif count = 0; } else count++; __enable_irq(); } }