| | Re: semaphores
|
|
a short example: #include <semaphore.h> // for semaphore opperations // global buffer, used to store incoming messages. // the buffer is checked by the application waiting for the message. struct inn_msg{ char *msg; sem_t lock; }; //create a (...) (23 years ago, 9-May-02, to lugnet.robotics.rcx.legos)
|
|
| | semaphores
|
|
Does anyone have any code that implements semaphores and shows where they might be useful? That is one place that the documentation seems a little weak. Thanks, Sam (23 years ago, 9-May-02, to lugnet.robotics.rcx.legos)
|
|
| | Re: ___cmpsi2
|
|
(...) Had to look myself to belive it. But you are right, cmpsi2 is in the 0.2.6 system, but not in the 0.2.5 system. (...) No, that are the wrong ones. You need the lib functions for the cross compiled code. libgcc.a is code that gcc needs on your (...) (23 years ago, 9-May-02, to lugnet.robotics.rcx.legos)
|
|
| | Re: ___cmpsi2
|
|
(...) I don't find cmpsi2 in the sources of LegOS 0.2.5 (in lib/mint)! I found a _cmpsi2.o in libgcc.a (from egcs 1.1.2), but I really don't know how gcc (and ld) uses that library. The makefiles come from the LegOS tarball. According to the output, (...) (23 years ago, 9-May-02, to lugnet.robotics.rcx.legos)
|
|
| | Re: ___cmpsi2
|
|
(...) cmpsi2 is part of the libmint.a library. Would you please post (or send me) your source code and your Makefile? Regards, Mike (23 years ago, 9-May-02, to lugnet.robotics.rcx.legos)
|
|
| | ___cmpsi2
|
|
Using a multiplication between an int (in my case time_t) and a double number results in the following error: main.o(.text+0x72):main.c: undefined reference to `___cmpsi2' Can someone help me? I'm running egcs 1.1.2 and binutils 2.12. Eric (23 years ago, 9-May-02, to lugnet.robotics.rcx.legos)
|
|
| | Re: Powered Sensors
|
|
Ok, I have gotten myself confused again. 0-0.32mA represents a voltage dropbetween 0 - 3.2 volts. Therefore the voltage that the RCX "reads" on theA2D is between 5 - 1.8 volts (1023 - 368 RAW)? To get a reading of 0 (RAW)it seems as though you would (...) (23 years ago, 8-May-02, to lugnet.robotics.rcx.legos)
|
|
| | Re: Converting a float to an integer
|
|
(...) float f = 1.4; int i = (int)((i >= 0) ? i + 0.5 : i - 0.5); OR if (f >= 0) i = (int)(i + 0.5); else i = (int)(i - 0.5); This is assuming you want to round to the nearest integer. Just curious, where are you getting the ascii strings that you (...) (23 years ago, 8-May-02, to lugnet.robotics.rcx.legos)
|
|
| | Converting a float to an integer
|
|
Hopefully this isnt a silly question. Does anyone know how to covert a float to an integer? It doesn't appear that the function atoi exists. Michael. (23 years ago, 7-May-02, to lugnet.robotics.rcx.legos)
|
|
| | Re: Powered Sensors
|
|
----- Original Message ----- From: "John Barnes" <barnes@sensors.com> Newsgroups: lugnet.robotics.rcx.legos Sent: Tuesday, May 07, 2002 2:23 PM Subject: Re: Powered Sensors (...) the (...) across (...) Ok... lets see if I understand this.... For (...) (23 years ago, 7-May-02, to lugnet.robotics.rcx.legos)
|