File tree 1 file changed +44
-0
lines changed 1 file changed +44
-0
lines changed Original file line number Diff line number Diff line change @@ -259,6 +259,50 @@ Serial_::operator bool()
259
259
return result;
260
260
}
261
261
262
+ int32_t Serial_::readBreak () {
263
+ uint8_t enableInterrupts = ((__get_PRIMASK () & 0x1 ) == 0 );
264
+
265
+ // disable interrupts,
266
+ // to avoid clearing a breakValue that might occur
267
+ // while processing the current break value
268
+ __disable_irq ();
269
+
270
+ int32_t ret = breakValue;
271
+
272
+ breakValue = -1 ;
273
+
274
+ if (enableInterrupts) {
275
+ // re-enable the interrupts
276
+ __enable_irq ();
277
+ }
278
+
279
+ return ret;
280
+ }
281
+
282
+ unsigned long Serial_::baud () {
283
+ return _usbLineInfo.dwDTERate ;
284
+ }
285
+
286
+ uint8_t Serial_::stopbits () {
287
+ return _usbLineInfo.bCharFormat ;
288
+ }
289
+
290
+ uint8_t Serial_::paritytype () {
291
+ return _usbLineInfo.bParityType ;
292
+ }
293
+
294
+ uint8_t Serial_::numbits () {
295
+ return _usbLineInfo.bDataBits ;
296
+ }
297
+
298
+ bool Serial_::dtr () {
299
+ return _usbLineInfo.lineState & 0x1 ;
300
+ }
301
+
302
+ bool Serial_::rts () {
303
+ return _usbLineInfo.lineState & 0x2 ;
304
+ }
305
+
262
306
Serial_ Serial (USBDevice);
263
307
264
308
#endif
You can’t perform that action at this time.
0 commit comments