Jump to content

baptistou

Programmer
  • Posts

    54
  • Joined

  • Last visited

About baptistou

  • Birthday 05/04/1981

Profile Information

  • Gender
    Male
  • Location
    France

baptistou's Achievements

MIDIbox Newbie

MIDIbox Newbie (1/4)

0

Reputation

  1. Thanks guys, as a newbie I do agree to say that warnings are definitely useful: they teach you how to code properly! Best regards, Baptistou
  2. I agree I could easily add a function converting strings to hexadecimals. I didn't take care before today that u8 was unsigned while char is, but I don't understand why I didn't have any warning before updating my SVN folder. Anyways, how do I pass an unsigned variable to a function requiring a signed one?
  3. Hi nILS, I'm using strtol as it handles hexadecimal values, and my checksum are hexadecimal. I can't see why strtol has changed its behaviour from between the two version of the SVN folder. Also, now that I modified the other files of my project (and the compiler had to rebuild the .o files), I have this error with the function strncpy also everywhere. Has something changed in the declaration of the "u8" "u16" etc. ? It looks like "u8" are not equal to "char" anymore... Baptistou
  4. Hi all there, I've been using strtol function for a while in my program without any error. I updated the SVN repository folder on my computer this morning, and now without having changed anything from my program, everytime I compile I get: Creating object file for sentinel.c sentinel.c: In function 'Sentinel_ValidateChecksum': sentinel.c:222: warning: pointer targets in passing argument 1 of 'strtol' differ in signedness Any clue of what's happening in there? Here is the part of my sentinel.c causing these warnings: ///////////////////////////////////////////////////////////////////////////// // this takes a string, and validates it againts the checksum // at the end if the string. // returns 1 checksum OK -1 bad checksum -2 checksum not found in string ///////////////////////////////////////////////////////////////////////////// s8 Sentinel_ValidateChecksum(u8 *strPtr,u32 len) { u8 calculatedChecksum; u8 writtenChecksum[3]; char *next; u8 readChecksum; u8 c; u32 p; calculatedChecksum = Sentinel_GenerateChecksum(strPtr, len); p = 0; c = 0x00; while ((c != '*') && (p < len)) { c = strPtr[p]; p++; } if (p > len - 2) { //DEBUG_MSG("nmea_validateChecksum p > len -2"); return -2; } writtenChecksum[0] = strPtr[p]; writtenChecksum[1] = strPtr[p+1]; writtenChecksum[2] = 0x00; readChecksum = strtol(writtenChecksum, &next, 16); if (readChecksum == calculatedChecksum) { //DEBUG_MSG("nmea_validateChecksum checksum OK"); return 1; } //DEBUG_MSG("S-- wrong checksum (read %x calculated %x)\n", readChecksum, calculatedChecksum); //DEBUG_MSG("%s \n", strPtr); return -1; }
  5. Hi again, I've been having little troubles with the com interface and windows XP. I just downloaded the com_console example to my core32, and when I plug it to a winXP computer through USB windows just doesn't recognise the hardware (which can be seen in the device manager as unknown device). I've installed ftdi and prolific usb to com drivers but nothing has changed. What kind of driver should I give to windows XP and where could I find them? Best regards Baptistou
  6. Thorsten, once again I'm quite impressed by your responsiveness! Thanks for your support. Best regards Baptistou
  7. Hi Thorsten, Do you mean that you can use up to 8 USB midi ports but that won't work with USB com ports? I'm programming with mac os X and my core will sometimes be plugged to a winXP computer. I already know that I need to disable midi if I plan to use com instead when on winXP. Being able to change the baudrate on the fly would be a plus for me but I'm not in a hurry for that function. For now I compile my program with different parameters and upload the proper one when I need it. Kind regards Baptistou
  8. Hi There, First of all, is there a place where I can find all the variables that can be defined in mios32_config.h? Second question: how do we set up the number of USB ports we want to use? I would like to use 2 or 3 com ports through usb, I guess I first need to put #define MIOS32_USE_USB_COM in the config.h as in the com_console example, but then how do you set up the number of coms? Third one: can we change the baudrate of UART0 and UART1 on the fly while the app is running? Thanks all Baptistou
  9. Thanks guys, I've spend the whole day programming yesterday and couldn't write more smart stuff by the end of the day. This saves me a lot of time! Baptistou
  10. Hi all there, A quite small question: is there a simple way to convert a string into a number? On google I've seen plenty of stuff with the atoi function but it doesn't seem to work with me. I have a string that looks like this: "0xA3" and want to put that A3 hexadecimal value into a u8 number. Anyone can help? Best regards Baptistou
  11. Hi, Most of the time in a swich matrix you apply a voltage on a row and check wich swich is closed in the column (or the opposite). The buttons in a column are all connected to the same input on the electronic system. That way you apply the voltage on one single row at a time, thus selecting wich buttons will be active, you get their state and you go on with the nex row and so on. I doubt that it is as you say one button closes two swiches. I haven't done that with a midibox but I know that many other people do so that must not be that complicated to handle. I don't know if you can go faster than 1ms per row but that should be enough anyways. The functionnality you are looking for is probably "blm" (button led matrix), have a look at the examples for mios8 or mios32. I guess that you'll need to do something to separate your keyboard electronics from the midibox's ones Baptistou
  12. nILS you are quicker than me for pressing post! :thumbsup:
  13. I think it's 12 bits but I haven't tried it yet, I should do that by the end of the week. I think also that as the Core32 is powered by 3.3V the AIN range is from 0 to 3.3v can anybody confirm? Then I heard somewhere that its easy to get jitter (12 bits resolution on a 3.3V range means 0,8 millivolts steps) and to avoid this it's better to uses shielded cables between the pots and the AINs, and between the AIN and the core, or to reduce at maximum the wire distances. Baptistou
  14. Hi, Thanks for the explanation, that's what I expected. I still have a question: if I understand properly the example given by TK, the tasks TASK_LCD1 and TASK_LCD2 will be stopped at line "MUTEX_LCD_TAKE" until the mutex is free. Is there a way to skip some instructions if the mutex is not free rather than wait for it? Baptistou
×
×
  • Create New...