minor edits to library_surveyor.c

git-svn-id: http://picoc.googlecode.com/svn/trunk@221 21eae674-98b7-11dd-bd71-f92a316d2d60
This commit is contained in:
surveyor.com 2009-04-08 01:42:44 +00:00
parent 414ae8a3c2
commit eed2b99515

View file

@ -123,19 +123,18 @@ void Cpoke(struct ParseState *Parser, struct Value *ReturnValue, struct Value **
switch (size) { switch (size) {
case 1: // char * case 1: // char *
cp = (unsigned char *)ptr; cp = (unsigned char *)ptr;
printf("cp = 0x%x\n\r", (int)cp);
*cp = (unsigned char)(val & 0x000000FF); *cp = (unsigned char)(val & 0x000000FF);
break; break;
case 2: // short * case 2: // short *
sp = (unsigned short *)(ptr & 0xFFFFFFFE); sp = (unsigned short *)(ptr & 0xFFFFFFFE);
printf("sp = 0x%x\n\r", (int)sp);
*sp = (unsigned short)(val & 0x0000FFFF); *sp = (unsigned short)(val & 0x0000FFFF);
break; break;
case 4: // int * case 4: // int *
ip = (unsigned int *)(ptr & 0xFFFFFFFC); ip = (unsigned int *)(ptr & 0xFFFFFFFC);
printf("ip = 0x%x\n\r", (int)ip);
*ip = val; *ip = val;
break; break;
default: // don't bother with bad value
break;
} }
} }
@ -634,6 +633,7 @@ struct LibraryFunction PlatformLibrary[] =
{ Cpeek, "int peek(int, int)" }, { Cpeek, "int peek(int, int)" },
{ Cpoke, "void poke(int, int, int)" }, { Cpoke, "void poke(int, int, int)" },
{ Cmotors, "void motors(int, int)" }, { Cmotors, "void motors(int, int)" },
{ Cmotors2, "void motors2(int, int)" },
{ Cservos, "void servos(int, int)" }, { Cservos, "void servos(int, int)" },
{ Cservos2, "void servos2(int, int)" }, { Cservos2, "void servos2(int, int)" },
{ Claser, "void laser(int)" }, { Claser, "void laser(int)" },