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.
Diff: quick_queue.cpp
- Revision:
- 12:e21604b50719
- Parent:
- 11:1d277e7e272d
diff -r 1d277e7e272d -r e21604b50719 quick_queue.cpp
--- a/quick_queue.cpp Mon Oct 16 00:27:07 2017 +0000
+++ b/quick_queue.cpp Mon Oct 16 01:51:32 2017 +0000
@@ -12,7 +12,7 @@
// Utilise pour aller chercher une pointeur vers un message a remplir pour l'envoi
radio_message_t* get_new_out_message(){
- if ((out_input_index + 1) % MESSAGE_BUFFER_SIZE != out_output_index)
+ if (((out_input_index + 1) % MESSAGE_BUFFER_SIZE) != out_output_index)
{
return &(out_messages[(out_input_index + 1) % MESSAGE_BUFFER_SIZE]);
//return true;
@@ -22,7 +22,7 @@
// Inique que le message courant est pret a etre envouye
bool new_out_message_ready(){
- if ((out_input_index + 1) % MESSAGE_BUFFER_SIZE != out_output_index)
+ if (((out_input_index + 1) % MESSAGE_BUFFER_SIZE) != out_output_index)
{
out_input_index = (out_input_index + 1) % MESSAGE_BUFFER_SIZE;
return true;
@@ -56,7 +56,7 @@
// Utilise pour aller recuperer un nouveau message a remplir pour la reception
radio_message_t* get_new_in_message(){
- if ((in_input_index + 1) % MESSAGE_BUFFER_SIZE != in_output_index)
+ if (((in_input_index + 1) % MESSAGE_BUFFER_SIZE) != in_output_index)
{
return &(in_messages[(in_input_index + 1) % MESSAGE_BUFFER_SIZE]);
//return true;
@@ -66,7 +66,7 @@
// Indique qu'un nouveau message est pret en entree
bool new_in_message_ready(){
- if ((in_input_index + 1) % MESSAGE_BUFFER_SIZE != in_output_index)
+ if (((in_input_index + 1) % MESSAGE_BUFFER_SIZE) != in_output_index)
{
in_input_index = (in_input_index + 1) % MESSAGE_BUFFER_SIZE;
return true;
@@ -96,4 +96,15 @@
return true;
}
return false;
+}
+
+
+int get_input_out_index()
+{
+ return in_output_index;
+}
+
+int get_input_in_index()
+{
+ return in_input_index;
}
\ No newline at end of file