Post Created date
Solved: Can't make encoder work correctly
The code in the article has this line: old_AB |= ( ENC_RD & 0x03 ); While your code has this line: old_AB |= (ENC_PORT & 0x0C); //read pins 2 and 3 simultaneouslyI...
Tuesday, 25 July 2017 - 18:32
Please share C++ projects that is based on OOP
JohanEkdahl wrote: Interesting. I will definitively have a look. Still, the author does the mistake (IMO) of not adopting the naming style of classes beginning with a capital...
Monday, 24 July 2017 - 15:54
What Makes C++ "Hard"?
OK, I'm at a computer now with some examples to show what I mean.   Here's my first example of designated initializers, for mapping arrays: const char *error_messages...
Sunday, 23 July 2017 - 23:41
What Makes C++ "Hard"?
clawson wrote: I'm now hard pushed to think of any way in which C is "better" than C++ and all this talk of slow/bloaty clearly comes from the ill informed who obviously aren't...
Sunday, 23 July 2017 - 15:05
What Makes C++ "Hard"?
Scroungre wrote: Okay, if you really want to fight, show me C code that divides by 256 (and truncates) and I'll show you assembler that is faster.  S.   I'll bite. How...
Friday, 14 July 2017 - 19:34
What Makes C++ "Hard"?
westfw wrote:At the moment, people seem to be all excited about "lambdas", and I'm thinking "pointers to functions; big deal.  Except now you don't have to explicitly write...
Wednesday, 12 July 2017 - 00:37
Is longjmp incompatible with serial on the ATmega32U4?
That should work fine (your code in post #16). But you also want to look at the return value of setjmp if you want to know if an exception happened.
Friday, 6 May 2016 - 14:18
Problem with a function that return a structure
C has supported returning a struct from a function since C89. In all of the ABIs that I'm familiar with, the caller allocates space for the structure (typically in its stack frame...
Friday, 6 May 2016 - 14:14
Is longjmp incompatible with serial on the ATmega32U4?
You call setjmp from setup and then return from setup. This invalidates the stack frame where setjmp was called from, so you cannot longjmp back to it. You can longjmp only to a...
Thursday, 5 May 2016 - 18:42
Why to use a ringbuffer in usart peripheral (receiving) ?
theusch wrote: netizen wrote: theusch wrote: How many elements are contained in the buffer when this macro is invoked with m_putIdx of 2 and m_getIdx of 6? Will you get the same...
Wednesday, 20 April 2016 - 15:57
A bit of fun - new way to program AVRs - beta testers invited!
Just a note: bit fields have implementation-defined signedness if you don't specify "signed" or "unsigned". AVR-GCC defaults to signed bit fields, I believe, which may give...
Tuesday, 5 April 2016 - 16:46
Returning variables from a function call
In some implementations, the calling convention for calling a function that returns a struct is for the caller to allocate space for the return value and then pass a pointer to...
Monday, 21 September 2015 - 18:51

Pages