Re: [avr-libc-dev] C11 Atomics and GCC libatomic

2016-06-25 Thread Jacob Moroni
Got it. I'll add the support to GCC's libatomic then send it in. Thanks.
On Jun 25, 2016 5:13 PM, "Joerg Wunsch"  wrote:

> As Georg-Johann Lay wrote:
>
> > As libatomic will need close cooperation with the compiler, I'd
> > recommend to add it to GCC.
>
> That would be my recommendation, too.  If it's a compile feature,
> it would better be there.  Perhaps it's then even possible to find
> a more efficient implementation (no function call overhead).
> --
> cheers, Joerg   .-.-.   --... ...--   -.. .  DL8DTL
>
> http://www.sax.de/~joerg/
> Never trust an operating system you don't have sources for. ;-)
>
> ___
> AVR-libc-dev mailing list
> AVR-libc-dev@nongnu.org
> https://lists.nongnu.org/mailman/listinfo/avr-libc-dev
>
___
AVR-libc-dev mailing list
AVR-libc-dev@nongnu.org
https://lists.nongnu.org/mailman/listinfo/avr-libc-dev


Re: [avr-libc-dev] C11 Atomics and GCC libatomic

2016-06-25 Thread Joerg Wunsch
As Georg-Johann Lay wrote:

> As libatomic will need close cooperation with the compiler, I'd 
> recommend to add it to GCC.

That would be my recommendation, too.  If it's a compile feature, 
it would better be there.  Perhaps it's then even possible to find 
a more efficient implementation (no function call overhead).
-- 
cheers, Joerg   .-.-.   --... ...--   -.. .  DL8DTL

http://www.sax.de/~joerg/
Never trust an operating system you don't have sources for. ;-)

___
AVR-libc-dev mailing list
AVR-libc-dev@nongnu.org
https://lists.nongnu.org/mailman/listinfo/avr-libc-dev


[avr-libc-dev] Convenient macros

2016-06-25 Thread Aleksey Kuleshov
Hello!

Maybe I just don't know something, but I made convenient macros which turns 
this code:
[code]
...
// For request
DDRA &= ~_BV(PA2);
// For LED
DDRB |= _BV(PB3);

// Wait for request
loop_until_bit_is_set(PINA, PA2);
// Turn LED on
PORTB |= _BV(PB3);
...
[/code]

into this completely equivalent code:

[code]
...

#define LED_PORT B
#define LED_PIN 3

#define REQ_PORT A
#define REQ_PIN 2

...

CONF_IN(REQ);
CONF_OUT(LED);

WAIT_1(REQ);
SET_1(LED);

...
[/code]

Note that in the first code it's easy to make a mistake and remember what 
port/pin is for.
The second code is self-explaining + no mentioned mistakes can ever be made!
Someone need this or it's just me who made bicycle?

___
AVR-libc-dev mailing list
AVR-libc-dev@nongnu.org
https://lists.nongnu.org/mailman/listinfo/avr-libc-dev