]> cloudbase.mooo.com Git - irmp.git/blobdiff - irsnd.c
Version 1.6.5: handle uint8_t overflow above 15395 Hz
[irmp.git] / irsnd.c
diff --git a/irsnd.c b/irsnd.c
index 2df0b02a529ce6cb736bef24e8fc8807a272f2b2..570b916aec696bf9abbba97de14048be06ffe78f 100644 (file)
--- a/irsnd.c
+++ b/irsnd.c
@@ -3,7 +3,7 @@
  *\r
  * Copyright (c) 2010 Frank Meyer - frank(at)fli4l.de\r
  *\r
- * $Id: irsnd.c,v 1.16 2010/06/08 23:34:14 fm Exp $\r
+ * $Id: irsnd.c,v 1.19 2010/06/14 15:55:11 fm Exp $\r
  *\r
  * This program is free software; you can redistribute it and/or modify\r
  * it under the terms of the GNU General Public License as published by\r
@@ -276,7 +276,7 @@ bitsrevervse (uint16_t x, uint8_t len)
 \r
 \r
 uint8_t\r
-irsnd_send_data (IRMP_DATA * irmp_data_p)\r
+irsnd_send_data (IRMP_DATA * irmp_data_p, uint8_t do_wait)\r
 {\r
 #if IRSND_SUPPORT_RECS80_PROTOCOL == 1\r
     static uint8_t  toggle_bit_recs80;\r
@@ -290,9 +290,16 @@ irsnd_send_data (IRMP_DATA * irmp_data_p)
     uint16_t        address;\r
     uint16_t        command;\r
 \r
-    while (irsnd_busy)\r
+    if (do_wait)\r
     {\r
-        ;\r
+        while (irsnd_busy)\r
+        {\r
+            // do nothing;\r
+        }\r
+    }\r
+    else if (irsnd_busy)\r
+    {\r
+        return (FALSE);\r
     }\r
 \r
     irsnd_protocol  = irmp_data_p->protocol;\r
@@ -1305,7 +1312,7 @@ main (int argc, char ** argv)
 \r
         irsnd_init ();\r
 \r
-        (void) irsnd_send_data (&irmp_data);\r
+        (void) irsnd_send_data (&irmp_data, TRUE);\r
 \r
         while (irsnd_busy)\r
         {\r