In the file "IBus_Write.ino" I noticed the line last_tx = millis() + 30; //take a break.
That is not safe for the rollover problem. You may only remember the current value of millis() and only compare them by using: "the current millis - a previous millis".
In the file "Helper.ino", this multiply with a constant is dangerous: SHUT_DOWN_MINUTES*60000.
The compiler uses signed integers by default. I did not test it, but when using 30000, the compiler might do the calculation with normal signed integers and that might fail. By using 60000, the compiler knows that it is a large number, so perhaps it will work.
You can tell the compiler to do a unsigned long multiply with unsigned long numbers by adding "UL" to a value: SHUT_DOWN_MINUTES*60000UL.
A goto is a normal part of the 'c' language. It is however seen as a lack of programming skills. When code is well designed, there is no need to use any goto at all. I suggest to keep them if it works, but try to avoid them when writing new code.
In the file "IBus_Handler.ino", the function ibus_msg_handle() there is a goto. Why? There is not need to break out of two if-statements. You can remove that goto and the code will do the same.
The communication with the IBus uses normal text. A array of 'char' would be the best choice. You use sometimes the String object, but that does not make it easier, because you are converting normal text to a String and from a String to normal text.
For a Arduino Uno or Nano, some don't use any String object, because there is only little ram.
In the file "IBus_Write.ino" I noticed the line
last_tx = millis() + 30; //take a break.That is not safe for the rollover problem. You may only remember the current value of millis() and only compare them by using: "the current millis - a previous millis".
In the file "Helper.ino", this multiply with a constant is dangerous:
SHUT_DOWN_MINUTES*60000.The compiler uses signed integers by default. I did not test it, but when using 30000, the compiler might do the calculation with normal signed integers and that might fail. By using 60000, the compiler knows that it is a large number, so perhaps it will work.
You can tell the compiler to do a
unsigned longmultiply withunsigned longnumbers by adding "UL" to a value:SHUT_DOWN_MINUTES*60000UL.A
gotois a normal part of the 'c' language. It is however seen as a lack of programming skills. When code is well designed, there is no need to use anygotoat all. I suggest to keep them if it works, but try to avoid them when writing new code.In the file "IBus_Handler.ino", the function
ibus_msg_handle()there is agoto. Why? There is not need to break out of two if-statements. You can remove thatgotoand the code will do the same.The communication with the IBus uses normal text. A array of 'char' would be the best choice. You use sometimes the String object, but that does not make it easier, because you are converting normal text to a String and from a String to normal text.
For a Arduino Uno or Nano, some don't use any String object, because there is only little ram.