|
Well, your compiler and package probably came with header files describing built in I/O ports - look at those for the syntax.
But I'm sure what you wrote is wrong - I doubt the compiler will a space in the middle of a number.
The last embedded work I did was on a 32bit processor, so it may be harder for you (in which case, read headers as above), but the following worked for me:
unsigned int *pSomewhere = (unsigned int *)0x12341234;
Obviously that's not the real name or number, but I hope you get the idea. You may just need the odd far.
Iain.
|
|
|
|
|
yes,
thanks for your response.
the space, which you are talking about, i would have given it like that in forums but i gave it as a single value in my code. but still it wasnt working.
any ways,
iam trying to implement it using volatile.
thanks all for your suggestions.
--------------------------------------------
Suggestion to the members:
Please prefix your main thread subject with [SOLVED] if it is solved.
thanks.
chandu.
|
|
|
|
|
chandu004 wrote: but still it wasnt working.
Without seeing your code, how you are using it, and what you are expecting instead, this is less than helpful.
chandu004 wrote: iam trying to implement it using volatile.
Why?
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
DavidCrow wrote: Why?
It probably points to a memory-mapped io register that gets changed by some hardware event.
|
|
|
|
|
chandu004 wrote: i need to use the memory available at a predefined address, say for example, 0xe000 2828 in RAM.
This is most likely a physical address and depending on what ARM architecture you're developing for, you may have an MMU[^] that maps physical addresses to virtual. This means you have to check your documentation for the following:- Is your ARM architecture equipped with an MMU?
- If so, is it enabled?
- If 'yes', what API call are you supposed to make to read and write to and from physical addresses?
chandu004 wrote: int *i=0xe000 2828;
Like Iain said, the compiler will swallow a type cast such as
int* pAddr = (int*)0xe0002828; but depending on the MMU-stuff this will give you a virtual address which may not be what you need.
The documentation for your compiler and your chip ought to have information about this.
Finally:
Your problem is very specific to your environment, so it's very hard to advise you to anything but reading the documentation for your compiler and the chipset you're using. You haven't even informed us what ARM architecture you are targeting.
Also keep in mind that this forum is dedicated to developing windows applications with MFC and/or Win32 API, which is very different from developing for embedded systems.
Of course you may be developing with Windows CE for embedded systems, but you haven't really said so clearly. If that's the case you may need to call ReadPhysical()[^] or WritePhysical()[^].
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|
|
To add to the previous answers, some embedded compilers have a non-standard _at extension that would enable you to do something like:
int i _at(0xe0002828);
Otherwise, I would use something like:
int& i = *reinterpret_cast<int*> (0xe0002828);
|
|
|
|
|
If anybody has alread tried to build a help file for a program using MS Help Workshop, how can I set a certain topic as a start page ??
Thank you in advance.
"The Awaited Saviour", Mohammed Baqir Al Sadr
modified on Monday, November 10, 2008 5:28 AM
|
|
|
|
|
If [*] help workshop is the one that makes .chm files, then you will have a .hhp file somewhere in your list of files to be compiled.
At the top of mine, I have the following:
[OPTIONS]
Auto Index=Yes
Compiled file=MyChm.chm
Contents file=Table of Contents.hhc
Default Window=Main
Default topic=Welcome.htm
Display compile progress=No
Index file=MyChm.hhk
Language=0x809 English (United Kingdom)
Title=I made this special help
[WINDOWS]
Main=,"Table of Contents.hhc",,"Welcome.htm","Welcome.htm",,,,,0x42120,,0x3046,,0x1000000,,,,,,
[FILES]
A list of files here...
(OK, I've changed the odd word here and there to protect the guilty).
Default topic gives you the "unless they explicitly asked for another one, give them this" functionality.
Hope that helps,
Iain.
[*] I say IF as I never use the workshop itself, just the hhc.exe help compiler.
|
|
|
|
|
Thank you thousand times.
"The Awaited Saviour", Mohammed Baqir Al Sadr
|
|
|
|
|
Hi,
I am working on an mfc application in which I am opening a dialog box containing smileys on button click. Now what I want is to close the dialog dialog box with smileys when mouse click event is fired anywhere on the screen.
Thanks
Dhiraj Kumar Saini
|
|
|
|
|
Handle WM_KILLFOCUS...
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
Can you help me with some example or code as i havnt used it before
Thanks
|
|
|
|
|
Handle the WM_KILLFOCUS event and send a WM_CLOSE (also OnOK, OnCancel would solve ur problem) message to the dialog at the very end of this function.
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
Please tell me how to handle WM_KILLFOCUS message
|
|
|
|
|
In the same manner in which you handle other messages like WM_PAINT etc.... Write a OnKillFocus handler function for WM_KILLFOCUS and a corresponding entry should be added in the message map. Also do not forget to declare the function in the header file and then implement in the cpp file for your dialog that pops up
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
Add this to message map.
ON_WM_KILLFOCUS()
and add handler funciton
void CTrialMFCDlg::OnKillFocus(CWnd* pNewWnd)
{
CDialog::OnKillFocus(pNewWnd);
}
Also dont forget to add the handler declaration of the handler in class.
I hope it helps.
BTW: You can use class wizard to add the handler
Regards,
Sandip.
|
|
|
|
|
Sorry to bother you again but i want to ask you one thing.
In my application there is a chat dialog box whose name is CChatDlg. In this box there is a button with text as emoticons. On click of this button I am opening a new dialog CEmoticonsDlg without any title bar just on top of the emoticons button. This new dialog box is having 16 emoticons placed as bmp images on a button as is in the case of messanger .
Now in the case when no emoticons is selected and the user clicks any arear outside the CEmoticons dialog I want the Dialog CEmoticons to be closed.
Right now what i am able to do is that i need to select a emoticon and and on click event of it i am closing the dialog box as a result of which i need to select a smiley.
So please help me as to in whcih class I have to use the above cod ewhich you have provided.
|
|
|
|
|
Dhiraj kumar Saini wrote: So please help me as to in whcih class I have to use the above cod ewhich you have provided.
CEmoticonsDlg, since this is the dialog you want to be able to close by clicking on the background. (as in, not on any of the 16 buttons)
|
|
|
|
|
what code should i write in the messege handler ON_WM_KILLFOCUS
|
|
|
|
|
|
I have used the following message handler but now on clicking the emoticon button the dialogbox CEmoticonDlg is not being opened.
Please tell me whats the problem. Its urgent
void CEmotionsDlg::OnKillFocus(CWnd* pNewWnd)
{
CDialog::OnKillFocus(pNewWnd);
SendMessage(WM_CLOSE,0,0);
}
This is how I am opening the CEmoticonDlg Dialog box
void CChatDlg::OnEmotions()
{
CEmotionsDlg m_EmotionsDlg(this);
m_EmotionsDlg.DoModal();
}
Thanks In Advance
|
|
|
|
|
Your getting beyond anyone's ability to help you here. You need to put breakpoints in your code, and see what error codes are.
My suspicion is your CEmotionsDlg is starting, and stopping almost straight away.
Put a breakpoint in the OnKillFocus handler, and see if I'm right. Put a breakpoint in the OnInitDialog handler, see if it gets called. Put a breakpoint on the m_EmotionsDlg.DoModal(); line and follow the code inside. Do you get errors?
If in doubt, put breakpoints everywhere!
Maybe you have a breakpoint somewhere, and the act of swapping to the debugger is losing focus on your dialog, and...
Iain.
|
|
|
|
|
I have used the break points after domodal the control is going in InitDialog but not in the KillFocus Message Handler
|
|
|
|
|
Well, your dialog is starting (which is good news), but it is also finishing too early.
You need to find out why it's finishing early then. Ask yourself what you know about stopping dialog. Maybe the OnInitDialog is not working correctly. Maybe something in your code is stopping the dialog? Try a breakpoint in CDialog::EndDialog - it could tell you which bit of your code is killing the dialog. Same with OnClose...
If you still can't find it, comment out 99% of the dialog code until it stays up. Then start putting code back again until it breaks.
This is going to be a pain to track down, but none of it is rocket science. Just plod through your code until you find the offending line or two.
Iain.
|
|
|
|
|