Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > de.sci.electronics > #223207
| From | Michael Bäuerle <michael.baeuerle@gmx.net> |
|---|---|
| Newsgroups | de.sci.electronics |
| Subject | Re: Rechnen ist schwer |
| Date | 2017-02-11 16:55 +0000 |
| Message-ID | <AABYn0H5GdwAAAzo.A1.flnews@Server4.micha.freeshell.org> (permalink) |
| References | (2 earlier) <o7k8sb$hk0$3@news.albasani.net> <AABYnbksBG4AAAIy.A1.flnews@WStation5.stz-e.de> <eg6hbaFjtceU1@mid.individual.net> <AABYnzUhGdcAAAzo.A1.flnews@Server4.micha.freeshell.org> <slrno9uepp.47b.news-1457978346@a-tuin.ms.intern> |
Michael Schwingen wrote:
> On 2017-02-11, Michael Bäuerle <michael.baeuerle@gmx.net> wrote:
> > Gerald Oppen wrote:
> > >
> > > Mit dem IAR-Compiler zumindest funktioniert der 16Bit-Zugriff
> > > automatisch ohne diese manuelle schiebereien..
> > > ui16_AdcValue = ADC;
> >
> > AFAIK kann der GCC das nicht.
>
> Erzähl' das bitte meinem AVR-GCC nicht:
>
> // return ADC value if ready, -1 if not
> static int16_t get_adc(void)
> {
> // loop_until_bit_is_set(ADCSRA, ADIF);
> if (ADCSRA & _BV(ADIF))
> {
> ADCSRA |= _BV(ADIF);
> return ADC;
> }
> return -1;
> }
Danke für die Korrektur. Ich habe mal in die Headerfiles einer über
10 Jahre alten libc geschaut (memory mapped I/O bei einem ATmega128):
|
| #define ADC _SFR_IO16(0x04)
| #define _SFR_IO16(io_addr) _MMIO_WORD((io_addr) + 0x20)
| #define _MMIO_WORD(mem_addr) (*(volatile unsigned int *)(mem_addr))
Das ging also wohl schon immer und meine Erinnerung war falsch.
Back to de.sci.electronics | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Rechnen ist schwer Peter Thoms <dl6lat@darc.de> - 2017-02-10 10:51 +0100
Re: Rechnen ist schwer Udo Pi <UpNg$0001@ifmd.de> - 2017-02-10 11:26 +0100
Re: Rechnen ist schwer "MaWin" <me@private.net> - 2017-02-10 11:54 +0100
Re: Rechnen ist schwer Peter Thoms <dl6lat@darc.de> - 2017-02-10 12:38 +0100
Re: Rechnen ist schwer Peter Thoms <dl6lat@darc.de> - 2017-02-10 12:40 +0100
Re: Rechnen ist schwer Edzard Egberts <news@edzeg.net> - 2017-02-10 13:17 +0100
Re: Rechnen ist schwer Heiko Lechner <no.spam.to.me@arcor.de> - 2017-02-10 13:32 +0100
Re: Rechnen ist schwer Edzard Egberts <news@edzeg.net> - 2017-02-10 15:15 +0100
Re: Rechnen ist schwer Johannes Bauer <dfnsonfsduifb@gmx.de> - 2017-02-10 16:28 +0100
Re: Rechnen ist schwer Edzard Egberts <news@edzeg.net> - 2017-02-10 16:46 +0100
Re: Rechnen ist schwer Hans-Peter Diettrich <DrDiettrich1@aol.com> - 2017-02-11 13:00 +0100
Re: Rechnen ist schwer Michael Bäuerle <michael.baeuerle@stz-e.de> - 2017-02-10 13:59 +0100
Re: Rechnen ist schwer Gerald Oppen <Gerald.Oppen@web.de> - 2017-02-10 20:07 +0100
Re: Rechnen ist schwer Peter Thoms <dl6lat@darc.de> - 2017-02-11 00:35 +0100
Re: Rechnen ist schwer Michael Bäuerle <michael.baeuerle@gmx.net> - 2017-02-11 16:00 +0000
Re: Rechnen ist schwer Michael Schwingen <news-1457978346@discworld.dascon.de> - 2017-02-11 16:26 +0000
Re: Rechnen ist schwer Michael Bäuerle <michael.baeuerle@gmx.net> - 2017-02-11 16:55 +0000
Re: Rechnen ist schwer "MaWin" <me@private.net> - 2017-02-10 14:49 +0100
Re: Rechnen ist schwer Hans-Peter Diettrich <DrDiettrich1@aol.com> - 2017-02-10 13:46 +0100
Re: Rechnen ist schwer Johannes Bauer <dfnsonfsduifb@gmx.de> - 2017-02-10 16:30 +0100
Re: Rechnen ist schwer Michael Bäuerle <michael.baeuerle@stz-e.de> - 2017-02-10 17:02 +0100
Re: Rechnen ist schwer Hans-Peter Diettrich <DrDiettrich1@aol.com> - 2017-02-11 13:21 +0100
Re: Rechnen ist schwer Peter Thoms <dl6lat@darc.de> - 2017-02-11 16:32 +0100
Re: Rechnen ist schwer Peter Thoms <dl6lat@darc.de> - 2017-02-11 16:45 +0100
Re: Rechnen ist schwer Hans-Peter Diettrich <DrDiettrich1@aol.com> - 2017-02-13 00:06 +0100
Re: Rechnen ist schwer Peter Thoms <dl6lat@darc.de> - 2017-02-13 18:52 +0100
Re: Rechnen ist schwer Peter Thoms <dl6lat@darc.de> - 2017-02-10 15:26 +0100
Re: Rechnen ist schwer Rafael Deliano <rafael_deliano@arcor.de> - 2017-02-10 17:20 +0100
Re: Rechnen ist schwer Peter Thoms <dl6lat@darc.de> - 2017-02-11 00:44 +0100
csiph-web