This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Reentrant?

I rarely ask questions on this forum, but since I couldn't [easily] find it in the help-files, or on-line, I'm asking you guys.

I usually (like never) don't use the 'reentrant' pragma, but I think I may have to do that with a particular routine.

BUT I can't find the key-word that declares a function as reentrant. Am I missing something? Is there one for Keil's IDE tools? If so, what is its form? Can I get a link to the 'official' use of it?

Thanks in advance, and I need it asap because I need to pass this class and I don't want to really learn how to do this 'embedded' stuff anyway but the teacher keeps hounding me.

--Cpt. Vince Foster
2nd Cannon Place
Fort Marcy Park, VA

Parents Reply Children
  • ...but it hasn't made me a great musician!

    that was not my intention. But Jack's insinuation that the captain needs basic training after all these years is in simple terms - repugnant. The guy was/is building guided missiles, for god's sake (maybe that's Jack's problem...?).

  • "... The guy was/is building guided missiles ..."

    I trust you're not using the same associative logic which says that because someone is considered to be an intellectual, he is fit to run a country.

    Consider Gordon Brown - OMG ;-(

  • Whoops. I've wandered right off topic into politics.

    Many appologies.

  • don't worry about it. do you think this is a coincidence :-) :-)

    Gordon Brown
    George Bush

  • Well, I must say its nice to see people defend me from the Fish Brain. For the record, I worked with people who helped develop the ANSI Standards for "C" not C itself.

    Since I was in elementary school learning electronics et al, by the time I was in high-school, I designed my first battery operated EMBEDDED computer using the only low-power "CMOS" processor out there: the CDP1802.

    I hand-wrote the Intellec 8 HEX format files using an old CP/M computer (IMSAI 8080) and some of those friends of mine (who went to those meetings that Wozniak & Co went to "back in the day"---the "Homebrew Computer Club") would burn a PROM for me.

    So I'm kinda sorry I am missing "first year computer science." But somehow, I seemed to know as much as Per knows and that it is "prudent" to check.

    And back then we didn't exactly call it "computer science" anyway. It was either a degree in Electrical Engineering (EE) or Software Engineering (SE). Not "CS" whatever.

    I've watched Keil grow from non-existence to a big company. I've seen the 'other' cross compiler companies spring up and either fold or continue.

    Obviously, I stuck with Keil. I remember when the 8048 and 8051 came out. When the 80C51 came out, I converted my 'old' 1802 design over to it. I learned "C" using BDS Leor Zolman's new "C" compiler for the IMSAI system and then my Z80 based 'sweet' TeleVideo system.

    Most of the military work uses Ti DSPs (Code Composer) and Actel FPGAs... and surprisingly, the 80C51FB was used in a few of them: Archemedes (Yes, I know the Keil connection there), then Keil.

    I know what processor fits what application. In the missile world, the constraints on a system are very demanding: especially real-estate, not to mention 30,000 g loads.

    I loved the Led Zeppelin analogy (Best band on the planet EVER), but if that analogy was to apply, then I was some kid--learning music--who was hanging out with them as they wrote and practiced their stuff. Doesn't make me Led Zeppelin, but I learned from the best.

    Don't go down the Political Path, because like being an R&D Aero/Mil Senior Level EE/SE working on 'cutting edge' weapon systems (now I'm doing some Life-Science Bio work), I'm just as good at politics.... this is NOT the forum for that.

    --Cpt. Vince Foster
    2nd Cannon Place
    Fort Marcy Park, VA

    P.S. OMG, I'm surprised I even deal with sardine level people. And FYI the phrase "Blowing Crow" has to do with a crow's ability to count to three, and not four, so when you 'blow crow', you've exceeded your 'stack' capacity to handle anything complex.

  • I dare to say, captain, that some of us (me included, naturally...at least for a while) are totally out of their league...!
    I am confident that everybody here (except one person, maybe...) appreciates your contribution of this forum.

  • "I dare to say, captain, that some of us (me included, naturally...at least for a while) are totally out of their league...!"

    Are you saying that you are doing things you really should not do - being a fish out of the water?

    I started my first own design with the Z80 and a lot of wire-wrapping. I had access to a machine where I could write an assembler in BASIC, and then wrote monitor/assembler/disassembler in the evenings, and debugged in the head on the bus to school. Updated the assembler code and took a new hard-copy on a break and then home to continue to write some more code.

    Given the size of the design, it was most certainly not battery-operated - the board was about the size of an A4 page (12x8 inches) densely populated. Quite a lot of amps at 5V. Yet one more ancient project collecting dust somewhere. I think I'll have to OCR the source code someday - unless a couple of old classmates of mine happens to have any working 8" floppy drive for a ND (Nork Data) system.

    I don't know how many times I had to redesign, based on the current availability of logic chips - it was at the time when US and Japan was in a trade conflict after USA accused Japan of price dumping for logic chips.

    I think it's the strange hobby projects that teaches us the most - there are no natural limits. No teacher who says: This is enough. No customer who say: Too big or expensive or too late delivery date or too weird.

  • "I think it's the strange hobby projects that teaches us the most - there are no natural limits. No teacher who says: This is enough. No customer who say: Too big or expensive or too late delivery date or too weird."

    My home has an office with a full elex lab in it. Over $100K in [legal] software, and plenty in hardware tools. I don't do "hobby" things there. ("PICs are for kids"). I do 'real' projects... when I have the time: I have kids.

    Growing up, my summers were spent on my grandparent's ranch (10,000+ acres), and my grandfather taught me many things.

    One of which was simple: "If you are going to do something, do it right."

    From logging, to raising live-stock, to building fences to building barns, to building embedded systems, that rule always applies. If you half-ass it the first time, you'll--by far--spend more time and money getting it to work right later.

    The luxury of time and money does allow you to do it right, so Per's comment is very apt. But most of these "hobbyists," don't take the time (money is always an issue), to do it right.

    *IF* they do it right, they'll learn a lot the 'easy way' versus learning the 'hard-way' with band-aid patchworks, ad-hoc 'goto' statements, and ill-conceived pre-planning.

    In the real world, time & money are always pressures you must achieve. Doing it right the first time might seem to take 'too long' so its best to have a work environment that knows this rule and knows just how much more time and money is spent if you don't take the time to do the up-front [real engineering] work.

    --Cpt. Vince Foster
    2nd Cannon Place
    Fort Marcy Park, VA

  • I don't know the number of times I have had to fight quite hard to get a design passed, because it has been seen as too ambitios.

    On the other hand, I don't know the number of times that extra layer of maturity (general transfer protocols instead of minimalistic ones, separation of business logic and peripherials, ...) in the product has proven extremely valuable down the road when a customer has suddenly wanted big additions very late in the development cycle, or maybe even in products already installed in significant quantities.

    It's actually quite interesting to compare how some of the products are used, and relate back a couple of years to the originally planned uses. A couple of weeks ago, a customer managed a very quick and smooth certification of one of our products as a fire alarm system after very minor firmware updates. A fire routing equipment is of course not as sexy as some of the more advanced equipment in avionics, but I'm still quite happy to be able to take a product with a number of man-years invested in the software and do a couple of weeks of minor adjustments to fulfill a standard no one ever mentioned or talked about during the original design stage.

    In the military world, I would expect the designers to have a quite good view of the intended use. There isn't a week when there isn't a phone call from a customer asking "Can I use it as a xxx" (insert weather station, corporate firewall, redundant oil rig communicator, burglar alarm, supervisor of cellular base stations, POS terminal, econometer, route planner, data collector, PLC, passenger comfort supervisor, crash recorder, vehicle PC, vehicle radar, replacement for fixed phone lines, bus schedule predictor, info-sign controller/driver, talking sign, customs seal processor, money/weapons/valuables tracker, blue-light emergency recorder, ...). And that is just some of the saner requests - most delivered or quite likely to be delivered - for one single base product.

    It is quite funny to try to design hardware and software when the world is so full of people desperately willing to find new, and totally unplanned, uses for a product. In the end, every little innocent source line may be a potential show-stopper - or the deciding factor that convinces a customer to select the product.

  • Sorry for the previous rambling. What I wanted to say was probably not possiby to deduce from the text.

    In school, it is possible to guestimate the minimum requirements needed to get passed. In real life, it can be very hard to know what the minimum requirements are. At the same time, there is the business aspect that money invested should pay off. It's tricky to know how much to invest when you don't know if you will get any interested customers - or what they will be interested in.

  • Yes, in the Aero/Mil industry things get well defined and 'new' features are rarely added without a big deal being made. Yet still those little features added still occur... and often.

    As a boss of mine said (known as Miller's Law):

    "Resist All Temptation to Increase Expectation"

    Which meant not to imply to the customer that you can do this or that just because you know you can... they'll just expect it for free.

    In the R&D missile business, we're doing stuff that we don't know for sure if it will work even deep into the design cycles. That "MRM" (XM1111) project was a killer because we (I) had to fit 10 pounds of circuitry into a 1 ounce PWA. It was 'theoretically possible' but there are real-world aspects that were high-risk. But the MRM worked and we (not just me) made it work PERFECTLY. Excalibur (XM982) was similarly hard.

    Jobs that have ever-changing criteria are nightmares to deal with. So the more practical solution (in low-volume cases) is to over design it to be capable of expansion if needed. Then when that feedback comes in on how it is used, you can do a cost reduction and re design it for those high-volume jobs.

    I just want you to know, that 'sexy' R&D missiles and what you do Per are really the same thing. The only differences could be the funding and the amount of paperwork and qualifications the widgets need to go through. (Assuming that you also do that real engineering work up front, which I think you do indeed do).

    And don't worry about 'rambling' because I'm the worst offender of it.

    --Cpt. Vince Foster
    2nd Cannon Place
    Fort Marcy Park, VA

  • For the record, I worked with people who helped develop the ANSI Standards for "C" not C itself.

    Er, yes Vince. As you wish.

    Just a thought, but you have surely published enough of your fantasy cv in this thread to reveal your fantasy identity to another talented Googler?

  • I dare to say, captain, that some of us (me included, naturally...at least for a while) are totally out of their league...!
    I am confident that everybody here (except one person, maybe...) appreciates your contribution of this forum.

    Nobody could fail to appreciate the good Captain's contributions. I, for one, am truly grateful that such people exist.

  • Ho Jack,

    You must be supremely proud that Vince is using your name for target practicing (as he demonstrated here:http://www.keil.com/forum/docs/thread14479.asp).

    :-)

    A quick quote:

    locked_on_1 = Get_Evil_Bad_Guy_Image( IR_CAMERA_1, &sardine_image.frame.current  );
    
     locked_on_2 = Get_Evil_Bad_Guy_Image( IR_CAMERA_2, &sprat_image.frame.current    );
    
     locked_on_3 = Get_Evil_Bad_Guy_Image( IR_CAMERA_3, &smoked_image.frame.current   );
    
     locked_on_4 = Get_Evil_Bad_Guy_Image( IR_CAMERA_3, &jack_image.frame.current     );
    
     lock_complete = ( (    ( locked_on_1 != FALSE )
                         && ( locked_on_2 != FALSE )
                         && ( locked_on_3 != FALSE )
                         && ( locked_on_4 != FALSE )
    
                       ) != FALSE
                     )
                         ?     // ternary = ( cond==TRUE )? TRUE : FALSE ;
    
                        TRUE   // TRUE == !FALSE, so TRUE goes here
    
                         :
    
                        FALSE
                     ; // end ternary, end assignment
    
     // if true, then bad things happen to bad guys...
     if( lock_complete != FALSE )
     {
        Enable( BAD_THINGS );
        ...
     }
     else
     {
        Disable( BAD_THINGS ); // just in case
     }