{"push_id":679685918,"size":654,"distinct_size":654,"ref":"refs/heads/xmegaduino","head":"999bee116eee47e4e8fd922c8cf053e2e3f88b1b","before":"fc8895521a11234ce6ea38ebd43b331367904f85","commits":[{"sha":"a4e958f14728140c622b60293825fee4109ee5de","author":{"email":"775e87850952e92c84cbf52e961ca3ff0fc65cff@gmail.com","name":"sngl"},"message":"Updated YunClient::connect method'\nNow it stop the connection on the linux side when it fails","distinct":true,"url":"https://api.github.com/repos/Xmegaduino/Xmegaduino/commits/a4e958f14728140c622b60293825fee4109ee5de"},{"sha":"937cc51c693241cf6b7450ef5c61287bf73ee30e","author":{"email":"9dc3ff3d138562f97538d2d6494f1e5dc216015b@stdin.nl","name":"Matthijs Kooijman"},"message":"Clear SoftwareSerial rx delay if no interrupt register is found\n\nBefore enabling interupts, begin would see if the given receive pin\nactually has an associated PCINT register. If not, the interrupts would\nnot be enabled.\n\nNow, the same check is done, but when no register is available, the rx\nparameters are not loaded at all (which in turn prevents the interrupt\nfrom being enabled). This allows all code to use the same \"is rx\nenabled\" (which will be added next).","distinct":true,"url":"https://api.github.com/repos/Xmegaduino/Xmegaduino/commits/937cc51c693241cf6b7450ef5c61287bf73ee30e"},{"sha":"b1c7a3d05f7b7c69fe60279ea9037e130d32e8c3","author":{"email":"9dc3ff3d138562f97538d2d6494f1e5dc216015b@stdin.nl","name":"Matthijs Kooijman"},"message":"Let SoftwareSerial::listen() fail on invalid rx baud rates\n\nIn this case, SoftwareSerial::begin will not have enabled the\ninterrupts, so better not allow the SoftwareSerial instance to enter the\nlistening state either.","distinct":true,"url":"https://api.github.com/repos/Xmegaduino/Xmegaduino/commits/b1c7a3d05f7b7c69fe60279ea9037e130d32e8c3"},{"sha":"1704e7e820c78f38153e55b9ea3cc991095e9a57","author":{"email":"9dc3ff3d138562f97538d2d6494f1e5dc216015b@stdin.nl","name":"Matthijs Kooijman"},"message":"Let SoftwareSerial::end also check against _rx_delay_stopbit\n\nThe current check is still always false when the old check was, but\nadditionally it will not disable the interrupts when they were never\nenabled (which shouldn't matter much, but this is more consistent).","distinct":true,"url":"https://api.github.com/repos/Xmegaduino/Xmegaduino/commits/1704e7e820c78f38153e55b9ea3cc991095e9a57"},{"sha":"db1a4ad139b7efc52b3be4560fb5dddc3992f12a","author":{"email":"9dc3ff3d138562f97538d2d6494f1e5dc216015b@stdin.nl","name":"Matthijs Kooijman"},"message":"Add SoftwareSerial::setRxIntMsk()\n\nThis moves the interrupt mask enabling / disabling code into a separate\nmethod, so we can call it from multiple spots next.","distinct":true,"url":"https://api.github.com/repos/Xmegaduino/Xmegaduino/commits/db1a4ad139b7efc52b3be4560fb5dddc3992f12a"},{"sha":"934393398b5a5db0e822622ce7392f5d28143e9d","author":{"email":"9dc3ff3d138562f97538d2d6494f1e5dc216015b@stdin.nl","name":"Matthijs Kooijman"},"message":"Add SoftwareSerial::stopListening()\n\nThis allows one to explicitly stop a SoftwareSerial instance from\nlistening, without having to make another one listening.","distinct":true,"url":"https://api.github.com/repos/Xmegaduino/Xmegaduino/commits/934393398b5a5db0e822622ce7392f5d28143e9d"},{"sha":"b1de3e66219bd220743333404b464bc1e16c774a","author":{"email":"9dc3ff3d138562f97538d2d6494f1e5dc216015b@stdin.nl","name":"Matthijs Kooijman"},"message":"Toggle SoftwareSerial interrupts when starting / stopping to listen\n\nThis prevents interrupts from triggering when the SoftwareSerial\ninstance is not even listening.\n\nAdditionally, this removes the need to disable interrupts in\nSoftwareSerial::listen, since no interrupts are active while it touches\nthe variables.","distinct":true,"url":"https://api.github.com/repos/Xmegaduino/Xmegaduino/commits/b1de3e66219bd220743333404b464bc1e16c774a"},{"sha":"f3aa5f23c4b73028bb7403dc90469571eef5cc59","author":{"email":"9dc3ff3d138562f97538d2d6494f1e5dc216015b@stdin.nl","name":"Matthijs Kooijman"},"message":"Fix race condition in SoftwareSerial::overflow()\n\nIf an interrupt causing overflow would occur between reading\n_buffer_overflow and clearing it, this overflow condition would be\nimmediately cleared and never be returned by overflow().\n\nBy only clearing the overflow flag if an overflow actually occurred,\nthis problem goes away (worst case overflow() returns false even though\nan overflow _just_ occurred, but then the next call to overflow() will\nreturn true).","distinct":true,"url":"https://api.github.com/repos/Xmegaduino/Xmegaduino/commits/f3aa5f23c4b73028bb7403dc90469571eef5cc59"},{"sha":"6685aa999cf828a994cd81fac78b077a9692d654","author":{"email":"9dc3ff3d138562f97538d2d6494f1e5dc216015b@stdin.nl","name":"Matthijs Kooijman"},"message":"Use stopListening() in SoftwareSerial::end()\n\nstopListening also disabled the interrupt, if needed, so calling that\nfunction makes more sense. Since stopListening only disables the\ninterrupt when the current SoftwareSerial is the active object, and that\ncan only be the case when _rx_delay_stopbit is non-zero, there is no\nneed to separately check _rx_delay_stopbit anymore.","distinct":true,"url":"https://api.github.com/repos/Xmegaduino/Xmegaduino/commits/6685aa999cf828a994cd81fac78b077a9692d654"},{"sha":"416198a03b3517a76a6267680b42f8cf12b5c551","author":{"email":"9dc3ff3d138562f97538d2d6494f1e5dc216015b@stdin.nl","name":"Matthijs Kooijman"},"message":"Simplify SoftwareSerial::write\n\nBefore, there was nearly identical code for the inverted and regular\ncases. However, simply inverting the byte in the inverted case allows\nusing the regular code twice, reducing the generated code size by 100\nbytes (on an Arduino Uno and gcc 4.3, on gcc 4.8 the reduction is 50\nbytes).","distinct":true,"url":"https://api.github.com/repos/Xmegaduino/Xmegaduino/commits/416198a03b3517a76a6267680b42f8cf12b5c551"},{"sha":"80ea38b1dc55ffa43521c7e3ad55b79728fdf3cf","author":{"email":"9dc3ff3d138562f97538d2d6494f1e5dc216015b@stdin.nl","name":"Matthijs Kooijman"},"message":"Mark SoftwareSerial::tx_pin_write as \"always_inline\"\n\nSomehow gcc 4.8 doesn't inline this function, even though it is always\ncalled with constant arguments and can be reduced to just a few\ninstructions when inlined. Adding the always_inline attribute makes gcc\ninline it, saving 46 bytes on the Arduino uno.\n\ngcc 4.3 already inlined this function, so there are no space\nsavings there.","distinct":true,"url":"https://api.github.com/repos/Xmegaduino/Xmegaduino/commits/80ea38b1dc55ffa43521c7e3ad55b79728fdf3cf"},{"sha":"764f24266ec769af6f4d9b7bd1ebb18c7bbf0c3c","author":{"email":"9dc3ff3d138562f97538d2d6494f1e5dc216015b@stdin.nl","name":"Matthijs Kooijman"},"message":"Further optimize SoftwareSerial::write\n\nThis change restructures the loop, to help the compiler generate shorter\ncode (because now only the LSB of the data byte is checked and\nsubsequent bytes are shifted down one by one, it can use th \"skip if bit\nset\" instruction).\n\nFurthermore, it puts most attributes in local variables, which causes\nthe compiler to put them into registers. This makes the timing-critical\npart of the code smaller, making it easier to provide accurate timings.\n\nOn an Arduino uno using gcc 4.3, this saves 58 bytes. On gcc 4.8, this\nsaves 14 bytes.","distinct":true,"url":"https://api.github.com/repos/Xmegaduino/Xmegaduino/commits/764f24266ec769af6f4d9b7bd1ebb18c7bbf0c3c"},{"sha":"87f89f610072c3f4add1370b876b95d6793a8af8","author":{"email":"9dc3ff3d138562f97538d2d6494f1e5dc216015b@stdin.nl","name":"Matthijs Kooijman"},"message":"Optimize SoftwareSerial::recv\n\nSimilar to SoftwareSerial::write, this rewrites the loop to only touch\nthe MSB and then shift those bits up, allowing the compiler to generate\nmore efficient code. Unlike the write function however, it is not needed\nto put all instance variables used into local variables, for some reason\nthe compiler already does this (and doing it manually even makes the\ncode bigger).\n\nOn the Arduino Uno using gcc 4.3 this saves 26 bytes. Using gcc 4.8 this\nsaves 30 bytes.\n\nNote that this removes the else clause in the code, making the C code\nunbalanced, which looks like it breaks timing balance. However, looking\nat the code generated by the compiler, it turns out that the old code\nwas actually unbalanced, while the new code is properly balanced.","distinct":true,"url":"https://api.github.com/repos/Xmegaduino/Xmegaduino/commits/87f89f610072c3f4add1370b876b95d6793a8af8"},{"sha":"5af847d3a4fd7e055b591e3ba38a19da6d251926","author":{"email":"9dc3ff3d138562f97538d2d6494f1e5dc216015b@stdin.nl","name":"Matthijs Kooijman"},"message":"In SoftwareSerial, use ISR_ALIASOF to prevent duplication\n\nPreviously, up to four separate but identical ISR routines were defined,\nfor PCINT0, PCINT1, PCINT2 and PCINT3. Each of these would generate\ntheir own function, with a lot of push-popping because another function\nwas called.\n\nNow, the ISR_ALIASOF macro from avr-libc is used to declare just the\nPCINT0 version and make all other ISRs point to that one, saving a lot\nof program space, as well as some speed because of improved inlining.\n\nOn an Arduino Uno with gcc 4.3, this saves 168 bytes. With gcc 4.8, this\nsaves 150 bytes.","distinct":true,"url":"https://api.github.com/repos/Xmegaduino/Xmegaduino/commits/5af847d3a4fd7e055b591e3ba38a19da6d251926"},{"sha":"9d8f350ffe6892b619bc7cd6dd40033cab9d4621","author":{"email":"9dc3ff3d138562f97538d2d6494f1e5dc216015b@stdin.nl","name":"Matthijs Kooijman"},"message":"Mark SoftwareSerial::recv and handle_interrupt as always_inline\n\nSince those functions are only called once now, it makes sense to inline\nthem. This saves a few bytes of program space, but also saves a few\ncycles in the critical RX path.","distinct":true,"url":"https://api.github.com/repos/Xmegaduino/Xmegaduino/commits/9d8f350ffe6892b619bc7cd6dd40033cab9d4621"},{"sha":"ddbe3174f03c3ef9a3862bea038673fa253b8821","author":{"email":"9dc3ff3d138562f97538d2d6494f1e5dc216015b@stdin.nl","name":"Matthijs Kooijman"},"message":"In SoftwareSerial::recv, only calculate the new tail once\n\nThis shortens the generated code a bit more.","distinct":true,"url":"https://api.github.com/repos/Xmegaduino/Xmegaduino/commits/ddbe3174f03c3ef9a3862bea038673fa253b8821"},{"sha":"ce6b0f89e3622124745a29b60e02955c7e7f38e8","author":{"email":"9dc3ff3d138562f97538d2d6494f1e5dc216015b@stdin.nl","name":"Matthijs Kooijman"},"message":"Optimize SoftwareSerial::setRxIntMsk()\n\nThis precalculates the mask register and value, making setRxIntMask\nconsiderably less complicated. Right now, this is not a big deal, but\nsimplifying it allows using it inside the ISR next.","distinct":true,"url":"https://api.github.com/repos/Xmegaduino/Xmegaduino/commits/ce6b0f89e3622124745a29b60e02955c7e7f38e8"},{"sha":"08fa593916cf5b0a1ee93245e2f3363966083c98","author":{"email":"9dc3ff3d138562f97538d2d6494f1e5dc216015b@stdin.nl","name":"Matthijs Kooijman"},"message":"Disable the RX PCINT inside SoftwareSerial::recv\n\nBefore, the interrupt would remain enabled during reception, which would\nre-set the PCINT flag because of the level changes inside the received\nbyte. Because interrupts are globally disabled, this would not\nimmediately trigger an interrupt, but the flag would be remembered to\ntrigger another PCINT interrupt immediately after the first one is\nprocessed.\n\nTypically this was not a problem, because the second interrupt would see\nthe stop bit, or an idle line, and decide that the interrupt triggered\nfor someone else. However, at high baud rates, this could cause the\nnext interrupt for the real start bit to be delayed so much that the\nbyte got corrupted.\n\nBy clearing the interrupt mask bit for just the RX pin (as opposed to\nthe PCINT mask bit for the entire port), any PCINT events on other bits\ncan still set the PCINT flag and be processed as normal. In this case,\nit's likely that there will be corruption, but that's inevitable when\n(other) interrupts happen during SoftwareSerial reception.","distinct":true,"url":"https://api.github.com/repos/Xmegaduino/Xmegaduino/commits/08fa593916cf5b0a1ee93245e2f3363966083c98"},{"sha":"ead2881b1c0e2b650d8970185717b3f5ac6e517e","author":{"email":"9dc3ff3d138562f97538d2d6494f1e5dc216015b@stdin.nl","name":"Matthijs Kooijman"},"message":"Fix SoftwareSerial timings\n\nInstead of using a lookup table with (wrong) timings, this calculates\nthe timings in SoftwareSerial::begin. This is probably a bit slower, but\nsince it typically happens once, this shouldn't be a problem.\nAdditionally, since the lookup tables can be removed, this is also a lot\nsmaller, as well as supporting arbitrary CPU speeds and baudrates,\ninstead of the limited set that was defined before.\n\nFurthermore, this switches to use the _delay_loop_2 function from\navr-libc instead of a handcoded delay function. The avr-libc function\nonly takes two instructions, as opposed to four instructions for the old\none. The compiler also inlines the avr-libc function, which makes the\ntimings more reliable.\n\nThe calculated timings directly rely on the instructions generated by\nthe compiler, since a significant amount of time is spent processing\n(compared to the delays, especially at higher speeds). This means that\nif the code is changed, or a different compiler is used, the\ncalculations might need changing (though a few cycles more or less\nshouldn't cause immediate breakage).\n\nThe timings in the code have been calculated from the assembly generated\nby gcc 4.8.2 and gcc 4.3.2.\n\nThe RX baudrates supported by SoftwareSerial are still not unlimited. At\n16Mhz, using gcc 4.8.2, everything up to 115200 works. At 8Mhz, it works\nup to 57600. Using gcc 4.3.2, it also works up to 57600 at 16Mhz and up\nto 38400 at 8Mhz. Note that at these highest speeds, communication\nworks, but is still quite sensitive to other interrupts (like the\nmillis() interrupts) when bytes are sent back-to-back, so there still\nare corrupted bytes in RX.\n\nTX works up to 115200 for all combinations of compiler and clock rates.\n\nThis fixes #2019","distinct":true,"url":"https://api.github.com/repos/Xmegaduino/Xmegaduino/commits/ead2881b1c0e2b650d8970185717b3f5ac6e517e"},{"sha":"9cf3740a03da197e49101c0fc07d732735d76bb8","author":{"email":"9dc3ff3d138562f97538d2d6494f1e5dc216015b@stdin.nl","name":"Matthijs Kooijman"},"message":"Remove unneeded #ifdef in SoftwareSerial\n\nThe debugPulse function definition already checks for _DEBUG, resulting\nin an empty function definiton and the function call being optimized\naway.","distinct":true,"url":"https://api.github.com/repos/Xmegaduino/Xmegaduino/commits/9cf3740a03da197e49101c0fc07d732735d76bb8"}]}