

kos wrote:edit : using String the way it was proposed is ok , the way you dot it now i ok .. the only point is not calling serial.write() for individual char in a for .. it will slow the gui too much
EOSBandi wrote:If you don't have gps to test then please keep your hands off from the gps code. For example the i2c_init_done had it purpose, it is supposed to avoid i2c errors at startup from the i2c gps.
Tommie wrote:EOSBandi wrote:If you don't have gps to test then please keep your hands off from the gps code. For example the i2c_init_done had it purpose, it is supposed to avoid i2c errors at startup from the i2c gps.
But you are aware that the variable is not written anywhere?
And the function GPS_set_pids() (which is supposed to be guarded by this flag) is called during setup() no matter what?
About the change to the code:
I think there is no problem to modify the code as long as it concerns a feature which is well isolated by #define. (like LED_FLASHER or LCD). The risk is a superposition of individual features non coordinated leading to a sort of patchwork, but it would take too much time for me to coordinate everything. So as long as your code is clean and you take time to document and communicate on it, it's ok
For structural changes like PWM generation, I2C code, RX code, AUX button code, ...
We need in all cases to discuss about it and have a whole agreement in the forum before changing something that already works.
Alexinparis wrote:Serial comm is a structural change.
- I think you are a brillant coder
- size of payload: notice that INBUF_SIZE if 64 octets. It is coherent with the old payload limitation.
- I think you shouldn't touch what already works thank to kos for instance regarding the Serial transmission because currently the GUI is very laggy (1 update per second). So please, update in _shared only things you are sure of, and don't say that was not the good way to do (String allusion). If a thing can be better, no problem to change it, but it must work !
edit: it's better in r873, but it's still more laggy than before and something seems to be still not ok.
- beware before changing type of variable from int16_t to uint16_t. side effect on computation should be studied carrefully. exemple: GPS_WP_RADIUS, waypoint_speed_gov and max_speed.
Tommie wrote:It was a working set of code. [..]. It was a bug, something that happens during development.
copterrichie wrote:Guys, seems to me, we need to implement the CODE review procedure before code is committed to the main or shared libraries. Google Code does have that feature.
kos wrote:so , tommie's changes remain in the _shared .. .?
@tommie : let us know when you consider it stable
kos wrote:next release is not so far and shared must be maintained stable , agreement ?
Hamburger wrote:You may not know this, but _shared is meant as a common basis for working code as in work in progress. It is not your personal playgorund. It is not ok to leave your basic coding errors for others to stumble upon.
If I was your parent I'd say 'an apology is in order'. Having followed your arrogance on others' work and your ignorance disguised as friendly 'lets discuss' while ignoring arguments presented leads me to question your qualities as a contributor to an ongoing open group effort.
Hamburger wrote:You submitted a set of code that failed badly on basic functionality.
That was your fault. You definitely did not test it.
You may not know this, but _shared is meant as a common basis for working code as in work in progress. It is not your personal playgorund. It is not ok to leave your basic coding errors for others to stumble upon.
If I was your parent I'd say 'an apology is in order'. Having followed your arrogance on others' work and your ignorance disguised as friendly 'lets discuss' while ignoring arguments presented leads me to question your qualities as a contributor to an ongoing open group effort.
I do not know how to work on something at the same time as you do, I will from now on avoid it.
kos wrote:like Alex suggested : lets extends the new msp to the pid settings , once this is done we should be ok .
Tommie wrote:kos wrote:like Alex suggested : lets extends the new msp to the pid settings , once this is done we should be ok .
Done:
https://code.google.com/p/multiwii/source/detail?r=882
And the GUI has been updated as well, although it does not generate GUI elements from this message yet:
https://code.google.com/p/multiwii/source/detail?r=883
kos wrote:Tommie wrote:kos wrote:like Alex suggested : lets extends the new msp to the pid settings , once this is done we should be ok .
Done:
https://code.google.com/p/multiwii/source/detail?r=882
And the GUI has been updated as well, although it does not generate GUI elements from this message yet:
https://code.google.com/p/multiwii/source/detail?r=883
Ok ! I will extends the gui![]()
fiendie wrote:I think you've gone completely off the reservation.
Your accusations against Tommie are borderline paranoid and you should be careful not to poison the atmosphere just because things aren't handled your way.
You may not know this, but bugs happen all the time, with all the testing in the world. Last time I checked the changes were made to a Dev version. If there is no way to facilitate non-linear development problems like are likely to occur from time to time.
But your choice of words clearly shows what you're really up to here and it's got nothing to do with code quality.
Pyrofer wrote: if you want the bleeding edge in development code its in shared.
Alexinparis wrote:Flash size is precious, probably more than ram size.
Serial consumes a lot of ram memory, but
“256 is choosen to avoid modulo operations on 8 bits pointers” was introduced for a good reason.
=> at least 0.5k burned in the recent changes. And reducing operations made inside an ISR is critical.
Serialize32 and serialize16 are no more equivalent in the current code
=> some bytes burned
I suppose FLAG mods consumes also more flash memory.
Before putting efforts on RAM size, I would like to see if there is currently a concern about the limit and where the octets are spent.
Alexinparis wrote:- the GUI is laggy and it was not
Code: Select all
// send msp without payload
private List<Byte> requestMSP(int msp) {
return requestMSP( msp, null);
}
//send multiple msp without payload
private List<Byte> requestMSP (int[] msps) {
List<Byte> s = new LinkedList<Byte>();
for (int m : msps) {
s.addAll(requestMSP(m, null));
}
return s;
}
//send msp with payload
private List<Byte> requestMSP (int msp, Character[] payload) {
if(msp < 0) {
return null;
}
List<Byte> bf = new LinkedList<Byte>();
for (byte c : MSP_HEADER.getBytes()) {
bf.add( c );
}
byte checksum=0;
byte pl_size = (byte)((payload != null ? int(payload.length) : 0)&0xFF);
bf.add(pl_size);
checksum ^= (pl_size&0xFF);
bf.add((byte)(msp & 0xFF));
checksum ^= (msp&0xFF);
if (payload != null) {
for (char c :payload){
bf.add((byte)(c&0xFF));
checksum ^= (c&0xFF);
}
}
bf.add(checksum);
return (bf);
}
void sendRequestMSP(List<Byte> msp) {
byte[] arr = new byte[msp.size()];
int i = 0;
for (byte b: msp) {
arr[i++] = b;
}
/* send the complete byte sequence in one go */
g_serial.write(arr);
}
int availableMemory() {
int size = 1024; // Use 2048 with ATmega328
byte *buf;
while ((buf = (byte *) malloc(--size)) == NULL)
;
free(buf);
return size;
}
PatrikE wrote:Nope the led blinks continuisly..
And Processing Floods error messages.
Tryed all that...
Code: Select all
invalid checksum for command 101: 21 expected, got 1
invalid checksum for command 36: 81 expected, got 1
invalid checksum for command 101: 137 expected, got 1
invalid checksum for command 101: 137 expected, got 1
invalid checksum for command 102: 224 expected, got 172
invalid checksum for command 36: 81 expected, got 1
invalid checksum for command 102: 224 expected, got 172
invalid checksum for command 101: 43 expected, got 1
invalid checksum for command 102: 225 expected, got 172
invalid checksum for command 101: 36 expected, got 1
invalid checksum for command 101: 173 expected, got 1
invalid checksum for command 101: 137 expected, got 1
invalid checksum for command 116: 117 expected, got 0
invalid checksum for command 102: 238 expected, got 172
invalid checksum for command 101: 141 expected, got 1
invalid checksum for command 101: 221 expected, got 1
invalid checksum for command 101: 69 expected, got 1
invalid checksum for command 102: 224 expected, got 172
invalid checksum for command 102: 224 expected, got 172
invalid checksum for command 101: 108 expected, got 1
invalid checksum for command 116: 117 expected, got 0
invalid checksum for command 101: 87 expected, got 1
invalid checksum for command 101: 236 expected, got 1
invalid checksum for command 116: 117 expected, got 0
invalid checksum for command 116: 117 expected, got 0
invalid checksum for command 101: 56 expected, got 1
invalid checksum for command 102: 235 expected, got 172
invalid checksum for command 101: 25 expected, got 1
kos wrote:ok, you can test with the latest ?
Alexinparis wrote:This simple function launched at different place shows we are far from seeing a ram memory run out
That there is at least 400 bytes free in all cases I tested with 256 octets serial buffer for TX and RX.
Tommie wrote:(Yes, I experienced such overflows. It's not fun jumping after your copter before it plows into something you'd like to keep intact, like TV sets, mirrors, friends)
sismeiro wrote:It's bad what happened to you but fortunately you didn't harm yourself or other people. This is a reminder to all of us about the dangerous of this hobby and we can't be careless regarding any aspect of it. When testing developing code we need to be extra extra careful to avoid accidents, from now on I will be even more careful.
copterrichie wrote:In my opinion, this applies to stable code as well.
sismeiro wrote:copterrichie wrote:In my opinion, this applies to stable code as well.
Of course it does, I was not minimizing the implied danger whatever the nature of the code. That's why the "extra extra" and the "even more" I wrote.