Click here to Skip to main content
14,177,621 members

C / C++ / MFC

 
GeneralRe: volatile misbehaves Pin
Richard MacCutchan17-May-18 4:42
protectorRichard MacCutchan17-May-18 4:42 
GeneralRe: volatile misbehaves Pin
Vaclav_17-May-18 5:39
memberVaclav_17-May-18 5:39 
GeneralRe: volatile misbehaves Pin
supercat930-May-18 12:20
membersupercat930-May-18 12:20 
AnswerRe: volatile misbehaves Pin
Joe Woodbury17-May-18 5:48
professionalJoe Woodbury17-May-18 5:48 
GeneralRe: volatile misbehaves Pin
Vaclav_17-May-18 6:04
memberVaclav_17-May-18 6:04 
GeneralRe: volatile misbehaves Pin
Vaclav_17-May-18 7:24
memberVaclav_17-May-18 7:24 
AnswerRe: volatile misbehaves Pin
leon de boer18-May-18 8:16
memberleon de boer18-May-18 8:16 
GeneralRe: volatile misbehaves Pin
Vaclav_19-May-18 14:02
memberVaclav_19-May-18 14:02 
Thanks, I have not yet looked at your post.
You must have spent lots of time on it, and I appreciate it.
I have the code running , but...
I had to delete all volatiles to make it go.

Here is my simplistic view on my code and I am trying to figure out in what point the volatile keyword is causing the issue,
I basically see four steps in manipulating the hardware addresses.

As soon as I post this I'll study your post.
I am sure it will help me to understand this "addressing" mess better.

Sorry for the mess, but I have not figured out how to put parts of code under same roof.


if ((fp = fopen(BMC2835_RPI2_DT_FILENAME, "rb"))) {
unsigned char buf[4];
fseek(fp, BMC2835_RPI2_DT_PERI_BASE_ADDRESS_OFFSET, SEEK_SET);
if (fread(buf, 1, sizeof(buf), fp) == sizeof(buf))
bcm2835_peripherals_base = (uint32_t *) (buf[0] << 24 | buf[1] << 16
| buf[2] << 8 | buf[3] << 0);
fseek(fp, BMC2835_RPI2_DT_PERI_SIZE_OFFSET, SEEK_SET);
if (fread(buf, 1, sizeof(buf), fp) == sizeof(buf))
bcm2835_peripherals_size = (buf[0] << 24 | buf[1] << 16
| buf[2] << 8 | buf[3] << 0);


/* Base of the peripherals block is mapped to VM */
bcm2835_peripherals = (uint32_t*) mapmem("gpio", bcm2835_peripherals_size,
memfd, (uint32_t) bcm2835_peripherals_base);


bcm2835_gpio = (uint32_t*) bcm2835_peripherals +
BCM2835_GPIO_BASE / 4;



// volatile uint32_t* paddr = bcm2835_gpio + BCM2835_GPFSEL0 / 4 + (pin / 10);
paddr = bcm2835_gpio + BCM2835_GPFSEL0 / 4 + (pin / 10);
GeneralRe: volatile misbehaves Pin
Vaclav_19-May-18 14:36
memberVaclav_19-May-18 14:36 
GeneralRe: volatile misbehaves Pin
leon de boer20-May-18 4:41
memberleon de boer20-May-18 4:41 
GeneralRe: volatile misbehaves Pin
Vaclav_20-May-18 5:44
memberVaclav_20-May-18 5:44 
GeneralRe: volatile misbehaves Pin
leon de boer20-May-18 20:35
memberleon de boer20-May-18 20:35 
GeneralRe: volatile misbehaves Pin
Vaclav_21-May-18 3:18
memberVaclav_21-May-18 3:18 
GeneralRe: volatile misbehaves Pin
leon de boer21-May-18 4:33
memberleon de boer21-May-18 4:33 
Question__sync_synchronize stops processor ? Pin
Vaclav_16-May-18 10:31
memberVaclav_16-May-18 10:31 
AnswerRe: __sync_synchronize stops processor ? Pin
Randor 16-May-18 12:15
professional Randor 16-May-18 12:15 
GeneralRe: __sync_synchronize stops processor ? Pin
Vaclav_16-May-18 13:15
memberVaclav_16-May-18 13:15 
GeneralRe: __sync_synchronize stops processor ? Pin
Randor 16-May-18 14:10
professional Randor 16-May-18 14:10 
GeneralRe: __sync_synchronize stops processor ? Pin
Vaclav_17-May-18 3:22
memberVaclav_17-May-18 3:22 
QuestionTo install Visual Studio(2008 Pro,2010 Express and 2013 Express) in the same machine Pin
manoharbalu14-May-18 19:30
membermanoharbalu14-May-18 19:30 
AnswerRe: To install Visual Studio(2008 Pro,2010 Express and 2013 Express) in the same machine Pin
Victor Nijegorodov14-May-18 20:24
memberVictor Nijegorodov14-May-18 20:24 
GeneralRe: To install Visual Studio(2008 Pro,2010 Express and 2013 Express) in the same machine Pin
manoharbalu14-May-18 20:50
membermanoharbalu14-May-18 20:50 
GeneralRe: To install Visual Studio(2008 Pro,2010 Express and 2013 Express) in the same machine Pin
Victor Nijegorodov14-May-18 22:56
memberVictor Nijegorodov14-May-18 22:56 
GeneralRe: To install Visual Studio(2008 Pro,2010 Express and 2013 Express) in the same machine Pin
manoharbalu15-May-18 3:10
membermanoharbalu15-May-18 3:10 
GeneralRe: To install Visual Studio(2008 Pro,2010 Express and 2013 Express) in the same machine Pin
Victor Nijegorodov15-May-18 3:40
memberVictor Nijegorodov15-May-18 3:40 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.


Advertise | Privacy | Cookies | Terms of Service
Web05 | 2.8.190526.1 | Last Updated 27 May 2019
Copyright © CodeProject, 1999-2019
All Rights Reserved.
Layout: fixed | fluid