void GpioInit(void) { // Set to inputs FIO0DIR = \ FIO1DIR = \ FIO2DIR = \ FIO3DIR = \ FIO4DIR = 0;
// clear mask registers FIO0MASK =\ FIO1MASK =\ FIO2MASK =\ FIO3MASK =\ FIO4MASK = 0;
// Reset all GPIO pins to default primary function PINSEL0 =\ PINSEL1 =\ PINSEL2 =\ PINSEL3 =\ PINSEL4 =\ PINSEL7 =\ PINSEL8 =\ PINSEL9 =\ PINSEL10 = 0; }
How can I change PINSEL1 with this code?
(yawn)
you two carry on without me.
K Panjaab,
You should first remove all spaces behind \.
void GpioInit(void) { // Set to inputs FIO0DIR = \ // ^ A space at above position.
Then
PINSEL0 =\ PINSEL1 =55;
You set both PINSEL0 and PINSEL1 to 55. (0x37)
As Per Westermark already told you. But the OP should by now have figured out that the C compiler does not need any \ at the end of the lines to concatenate individual text lines into a single line. Not even when someone needs to print a very long text string is it needed to use any \ to split the text string over multiple lines.
This also works.
void GpioInit(void) { // Set to inputs FIO0DIR = FIO1DIR = FIO2DIR = FIO3DIR = FIO4DIR = 0; // clear mask registers FIO0MASK = FIO1MASK = FIO2MASK = FIO3MASK = FIO4MASK = 0; // Reset all GPIO pins to default primary function PINSEL0 = PINSEL1 = 55; PINSEL2 = PINSEL3 = PINSEL4 = PINSEL7 = PINSEL8 = PINSEL9 = PINSEL10 = 0; }
Thanku John Linq. With that post, the lazy OP got what he was searching for - a direct working answer.
And the guy ( or girl - the gender is stochastic here) has got a serious attitudinal problem.
by the way, k panjaab, which part of India do you hail from?
That is very true; but not in the way you thought.
The responses here are very good material for my research.
Some contributors discuss the unmentioned portion of the OP's question to better understand the question, and to provide better help to the OP. I think this fine.
However, doing a community behavior research might be OK here. But fooling people is very bad.
With that post, the lazy OP got what he was searching for - a direct working answer.
If you ever come to my town, stop me and ask "can you tell me the way to the station?", I'll be sure to just reply "yes" and carry on walking.
But when you get to a rental agency and ask "which car would you recommend", you would probably prefer if they check on your needs before recommending a car. If you are alone and want fun driving then a 2-seater or 2+2 car might be recommended. If you are going to move to a new apartment, then you might get more use of a van.
In your case - the direction to the station would probably differ for a pedestrian or if they have a car. And it would probably make a difference if they go there to pick some up with the car, or if they need to park the car before taking the train - the long-term parking lot might not be directly at the entrance.
In your case - the direction to the station would probably differ for a pedestrian or if they have a car.
In a role reversal, if I were to ask someone the way to the station and they then responded with "before I can answer that, you must explain in minute detail what the reason for your request is and what you intend to achieve when you get there and you must confirm that you have read and understood the ubiquitous webpage on how to ask a smart question", I'd just drive on and hope that the next person I ask is a little more sensible.
But a large number of people who on this site come and ask questions, doesn't just want to know the driving directions to the station. They also want to know the driving instructions for the car. You find them sitting on top of the roof of the car like Mr Bean, and they require information how to get the car running (does it need fuel too???) what button to press to get the car to correctly auto-navigate etc.
Some times it happens that the OP is a really genuine person who wants to get to station but doesnt know what are the possible ways to commute. But he is really interested to find good solution. Such OP really learns a lot from the counter question. A knowledge hungry OP - as i would term it.
But there are those other times, when the OP isnt really bothered about the car, the route or the distance or the time or any other resources invested to reach the station. He will readily take an aerial route (least bothering about the amount of resources needed to be invested) or will take a "around the city tour" and get down at the station when it comes - wasting a lot of time. Such OPs would learn nothing in the process resulting to a birth of yet another "i have a bachelor of Engineering degree" guy. Life's such a waste. the situation is worse when such an OP guides his juniors.
the situation is worse when such an OP guides his juniors. Thats how it is done. - plain answer. The junior is left with no choice but to agree.
read the following psychological story. skeptics.stackexchange.com/.../was-the-experiment-with-five-monkeys-a-ladder-a-banana-and-a-water-spray-condu
While counter questioning, there is a motto that people actually learn the concept which can further be used whenever they want, may be even in another situation.
That's very disturbing.
I will continue to carry my map so that I never need to ask you for directions.
That's very disturbing. There is nothing disturbing. Sometimes OPs dont have a smartphone or may not know that their mobilephone has a GPS access or may not know how to use the GPS feature on smartphone or may have a map which is in pieces. That doesnt mean that he is forbidden to go to station and that nobody must help him. If he is willing to learn and solve it on his own - with some assistance, the assistance must be given.
People are not born with maps or have learnt to use the maps just from their mothers womb.
And a lot of people on the forum are supposedly functional adults, and yet at the same time are totally clueless, or at venues of higher learning which seemed to have missed the bus on logical thinking, and problem solving.
So telling someone the station is a mile, or so, down the street is the appropriate answer, not trying to engage in intellectual combat, or argue about time-table or carriage appointment and paint schemes.