| Index: embios/trunk/Makefile | 
| — | — | @@ -13,6 +13,9 @@ | 
| 14 | 14 | preprocess = $(shell $(CC) $(PPCFLAGS) $(2) -E -P -x c $(1) | grep -v "^\#") | 
| 15 | 15 | preprocesspaths = $(shell $(CC) $(PPCFLAGS) $(2) -E -P -x c $(1) | grep -v "^\#" | sed -e "s:^..*:$(dir $(1))&:") | 
| 16 | 16 |  | 
|  | 17 | +REVISION := $(shell svnversion .) | 
|  | 18 | +REVISIONINT := $(shell echo $(REVISION) | sed -e "s/[^0-9].*$$//") | 
|  | 19 | + | 
| 17 | 20 | TARGETS := $(call preprocess,TARGETS,-I.) | 
| 18 | 21 |  | 
| 19 | 22 | define TARGET_template | 
| — | — | @@ -33,7 +36,7 @@ | 
| 34 | 37 | build/$(1)/$(NAME).elf: target/$(1)/ls.x build/$(1)/target/$(1)/crt0.o $$(OBJ_$(1)) | 
| 35 | 38 | $(LD) $(LDFLAGS) -o $$@ -T target/$(1)/ls.x $$(OBJ_$(1)) | 
| 36 | 39 |  | 
| 37 |  | -build/$(1)/%.o: %.c
 | 
|  | 40 | +build/$(1)/%.o: %.c build/version.h | 
| 38 | 41 | ifeq ($(shell uname),WindowsNT) | 
| 39 | 42 | @-if not exist $$(subst /,\,$$(dir $$@)) md $$(subst /,\,$$(dir $$@)) | 
| 40 | 43 | else | 
| — | — | @@ -45,7 +48,7 @@ | 
| 46 | 49 | @sed -e "s/.*://" -e "s/\\$$$$//" < $$@.dep.tmp | fmt -1 | sed -e "s/^ *//" -e "s/$$$$/:/" >> $$@.dep | 
| 47 | 50 | @rm -f $$@.dep.tmp | 
| 48 | 51 |  | 
| 49 |  | -build/$(1)/%.o: %.S
 | 
|  | 52 | +build/$(1)/%.o: %.S build/version.h | 
| 50 | 53 | ifeq ($(shell uname),WindowsNT) | 
| 51 | 54 | @-if not exist $$(subst /,\,$$(dir $$@)) md $$(subst /,\,$$(dir $$@)) | 
| 52 | 55 | else | 
| — | — | @@ -62,6 +65,12 @@ | 
| 63 | 66 |  | 
| 64 | 67 | $(foreach target,$(TARGETS),$(eval $(call TARGET_template,$(target)))) | 
| 65 | 68 |  | 
|  | 69 | +build/version.h: version.h .svn/entries build | 
|  | 70 | +	@sed -e "s/\$$REVISION\$$/$(REVISION)/" -e "s/\$$REVISIONINT\$$/$(REVISIONINT)/" < $< > $@ | 
|  | 71 | + | 
|  | 72 | +build: | 
|  | 73 | +	@mkdir build | 
|  | 74 | + | 
| 66 | 75 | clean: | 
| 67 | 76 | rm -rf build | 
| 68 | 77 |  | 
| Index: embios/trunk/global.h | 
| — | — | @@ -29,7 +29,7 @@ | 
| 30 | 30 | #include <stddef.h> | 
| 31 | 31 | #endif | 
| 32 | 32 |  | 
| 33 |  | -#define VERSION "0.0.1pre"
 | 
|  | 33 | +#include "build/version.h" | 
| 34 | 34 |  | 
| 35 | 35 | #define ICODE_ATTR __attribute__((section(".icode"))) | 
| 36 | 36 | #define ICONST_ATTR __attribute__((section(".irodata"))) | 
| — | — | @@ -48,6 +48,14 @@ | 
| 49 | 49 | #include "config.h" | 
| 50 | 50 | #include "target.h" | 
| 51 | 51 |  | 
|  | 52 | +#ifndef SCHEDULER_TICK | 
|  | 53 | +#define SCHEDULER_TICK 1048576 | 
|  | 54 | +#endif | 
|  | 55 | + | 
|  | 56 | +#ifndef SYSTEM_TICK | 
|  | 57 | +#define SYSTEM_TICK 10000 | 
|  | 58 | +#endif | 
|  | 59 | + | 
| 52 | 60 | #ifndef MAX_THREADS | 
| 53 | 61 | #define MAX_THREADS 32 | 
| 54 | 62 | #endif | 
| Index: embios/trunk/usb/synopsysotg.c | 
| — | — | @@ -366,3 +366,13 @@ | 
| 367 | 367 | /* reset the beast */ | 
| 368 | 368 | usb_reset(); | 
| 369 | 369 | } | 
|  | 370 | + | 
|  | 371 | +int usb_drv_get_max_out_size() | 
|  | 372 | +{ | 
|  | 373 | +    return usb_drv_port_speed() ? 262144 : 32768; | 
|  | 374 | +} | 
|  | 375 | + | 
|  | 376 | +int usb_drv_get_max_in_size() | 
|  | 377 | +{ | 
|  | 378 | +    return usb_drv_port_speed() ? 262144 : 32768; | 
|  | 379 | +} | 
| Index: embios/trunk/usb/usb.c | 
| — | — | @@ -304,12 +304,25 @@ | 
| 305 | 305 | { | 
| 306 | 306 | switch (dbgrecvbuf[0]) | 
| 307 | 307 | { | 
| 308 |  | -        case 1:  // GET VERSION
 | 
|  | 308 | +        case 1:  // GET INFO | 
| 309 | 309 | dbgsendbuf[0] = 1; | 
| 310 |  | -            dbgsendbuf[1] = 0x01010000;
 | 
| 311 |  | -            dbgsendbuf[2] = PLATFORM_ID;
 | 
| 312 |  | -            dbgsendbuf[3] = 0x02000200;
 | 
| 313 | 310 | size = 16; | 
|  | 311 | +            switch (dbgrecvbuf[1]) | 
|  | 312 | +            { | 
|  | 313 | +            case 0:  // GET VERSION INFO | 
|  | 314 | +                dbgsendbuf[1] = VERSION_MAJOR | (VERSION_MINOR << 8) | 
|  | 315 | +                              | (VERSION_PATCH << 16) | (1 << 24); | 
|  | 316 | +                dbgsendbuf[2] = PLATFORM_ID; | 
|  | 317 | +                dbgsendbuf[3] = VERSION_SVN_INT; | 
|  | 318 | +                break; | 
|  | 319 | +            case 1:  // GET PACKET SIZE INFO | 
|  | 320 | +                dbgsendbuf[1] = 0x02000200; | 
|  | 321 | +                dbgsendbuf[2] = usb_drv_get_max_out_size(); | 
|  | 322 | +                dbgsendbuf[3] = usb_drv_get_max_in_size(); | 
|  | 323 | +                break; | 
|  | 324 | +            default: | 
|  | 325 | +                dbgsendbuf[0] = 2; | 
|  | 326 | +            } | 
| 314 | 327 | break; | 
| 315 | 328 | case 2:  // RESET | 
| 316 | 329 | reset(); | 
| Index: embios/trunk/usb/usbdrv.h | 
| — | — | @@ -39,6 +39,8 @@ | 
| 40 | 40 | bool usb_drv_stalled(int endpoint, bool in); | 
| 41 | 41 | void usb_drv_stall(int endpoint, bool stall, bool in); | 
| 42 | 42 | void usb_drv_init(void); | 
|  | 43 | +int usb_drv_get_max_out_size(); | 
|  | 44 | +int usb_drv_get_max_in_size(); | 
| 43 | 45 |  | 
| 44 | 46 |  | 
| 45 | 47 | #endif | 
| Index: embios/trunk/thread.h | 
| — | — | @@ -29,14 +29,6 @@ | 
| 30 | 30 | #include "contextswitch.h" | 
| 31 | 31 |  | 
| 32 | 32 |  | 
| 33 |  | -#ifndef SCHEDULER_TICK
 | 
| 34 |  | -#define SCHEDULER_TICK 1048576
 | 
| 35 |  | -#endif
 | 
| 36 |  | -
 | 
| 37 |  | -#ifndef SYSTEM_TICK
 | 
| 38 |  | -#define SYSTEM_TICK 10000
 | 
| 39 |  | -#endif
 | 
| 40 |  | -
 | 
| 41 | 33 | #define TIMEOUT_NONE 0 | 
| 42 | 34 | #define TIMEOUT_BLOCK -1 | 
| 43 | 35 |  | 
| Index: embios/trunk/version.h | 
| — | — | @@ -0,0 +1,36 @@ | 
|  | 2 | +// | 
|  | 3 | +// | 
|  | 4 | +//    Copyright 2010 TheSeven | 
|  | 5 | +// | 
|  | 6 | +// | 
|  | 7 | +//    This file is part of emBIOS. | 
|  | 8 | +// | 
|  | 9 | +//    emBIOS is free software: you can redistribute it and/or | 
|  | 10 | +//    modify it under the terms of the GNU General Public License as | 
|  | 11 | +//    published by the Free Software Foundation, either version 2 of the | 
|  | 12 | +//    License, or (at your option) any later version. | 
|  | 13 | +// | 
|  | 14 | +//    emBIOS is distributed in the hope that it will be useful, | 
|  | 15 | +//    but WITHOUT ANY WARRANTY; without even the implied warranty of | 
|  | 16 | +//    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | 
|  | 17 | +//    See the GNU General Public License for more details. | 
|  | 18 | +// | 
|  | 19 | +//    You should have received a copy of the GNU General Public License along | 
|  | 20 | +//    with emBIOS.  If not, see <http://www.gnu.org/licenses/>. | 
|  | 21 | +// | 
|  | 22 | +// | 
|  | 23 | + | 
|  | 24 | + | 
|  | 25 | +#ifndef __VERSION_H__ | 
|  | 26 | +#define __VERSIONs_H__ | 
|  | 27 | + | 
|  | 28 | + | 
|  | 29 | +#define VERSION "0.0.1pre" | 
|  | 30 | +#define VERSION_MAJOR 0 | 
|  | 31 | +#define VERSION_MINOR 0 | 
|  | 32 | +#define VERSION_PATCH 1 | 
|  | 33 | +#define VERSION_SVN "$REVISION$" | 
|  | 34 | +#define VERSION_SVN_INT $REVISIONINT$ | 
|  | 35 | + | 
|  | 36 | + | 
|  | 37 | +#endif | 
| \ No newline at end of file |