Changeset 846
- Timestamp:
- 12/01/09 04:05:26 (3 years ago)
- Location:
- trunk/lib/ubasic
- Files:
-
- 4 edited
-
Makefile (modified) (1 diff)
-
camera_functions.c (modified) (4 diffs)
-
tokenizer.c (modified) (1 diff)
-
ubasic.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/ubasic/Makefile
r515 r846 12 12 13 13 check: 14 gcc -g -Wall -D TEST -DCAMERA_a610-o ubasic_test$(EXE) *.c14 gcc -g -Wall -DUBASIC_TEST -DCAMERA_$(PLATFORM) -DPLATFORMID=$(PLATFORMID) -o ubasic_test$(EXE) *.c 15 15 16 16 clean: -
trunk/lib/ubasic/camera_functions.c
r515 r846 1 #ifdef TEST1 #ifdef UBASIC_TEST 2 2 3 3 #include <stdio.h> 4 4 5 5 static int tv=0, av=0, zoom=0, focus=0, iso=0, raw=0, raw_nr=0,autostart=0; 6 6 int movie_status=0; 7 int shot_histogram_enabled=0; 8 int state_kbd_script_run=1; 9 int zoom_points = 3; 7 10 #define MODE_REC 0x0100 8 11 … … 135 138 int md_detect_motion(void) 136 139 { 140 printf("*** md_detect_motion ***\n"); 137 141 return 0; 138 142 } 139 143 int md_get_cell_diff(int column, int row) 140 144 { 145 printf("*** md_get_sell_diff %d %d ***\n", column, row); 141 146 return 0; 142 147 } 143 148 int md_init_motion_detector() 144 149 { 150 printf("*** md_init_motion_detector ***\n"); 145 151 return 0; 146 152 } … … 153 159 int ubasic_camera_get_nr(to) 154 160 { 161 printf("*** get raw nr ***\n"); 155 162 return raw_nr; 156 163 }; … … 413 420 } 414 421 415 416 417 418 422 int get_exposure_counter(void) 423 { 424 printf("*** get_exposure_counter ***\n"); 425 return 123; 426 } 427 428 429 int ubasic_camera_is_pressed(const char *v) 430 { 431 printf("*** ubasic_camera_is_pressed %s ***\n", v); 432 return 0; 433 } 434 435 436 int shot_histogram_get_range(int from, int to) 437 { 438 printf("*** shot_histogram_get_range %d,%d ***\n", from,to); 439 return 100; 440 } 441 442 void script_print_screen_statement(int v) 443 { 444 printf("*** script_print_screensatement %d ***\n", v); 445 } 446 447 int get_tick_count(void) 448 { 449 printf("*** get_tick_count ***\n"); 450 // what should it return ? 451 return 10; 452 } 453 454 short shooting_get_drive_mode() 455 { 456 printf("*** shooting_get_drive_mode ***\n"); 457 // what should it return ? 458 return 10; 459 } 460 461 int shot_histogram_isenabled() 462 { 463 printf("*** shot_histogram_isenabled ***\n"); 464 return shot_histogram_enabled; 465 } 466 467 int get_ccd_temp() 468 { 469 printf("*** get_ccd_temp ***\n"); 470 return 69; 471 } 472 int get_optical_temp() 473 { 474 printf("*** get_optical_temp ***\n"); 475 return 69; 476 } 477 478 int get_battery_temp() 479 { 480 printf("*** get_battery_temp ***\n"); 481 return 69; 482 } 483 484 void play_sound() 485 { 486 printf("*** play_sound ***\n"); 487 } 488 489 void TurnOnBackLight() 490 { 491 printf("*** TurOnBackLight ***\n"); 492 } 493 494 void TurnOffBackLight() 495 { 496 printf("*** TurnOffBackLight ***\n"); 497 } 498 499 void DoAFLock() 500 { 501 printf("*** DoAFLock ***\n"); 502 } 503 504 void UnlockAF() 505 { 506 printf("*** UnlockAF ***\n"); 507 } 508 509 int shot_histogram_set(int x) 510 { 511 printf("*** shot_histogram_set ***\n"); 512 return 1; 513 } 514 515 void levent_set_record() 516 { 517 printf("*** levent_set_record ***\n"); 518 } 519 520 void levent_set_play() 521 { 522 printf("*** levent_set_play ***\n"); 523 } 419 524 420 525 -
trunk/lib/ubasic/tokenizer.c
r826 r846 35 35 #endif 36 36 37 #ifdef TEST37 #ifdef UBASIC_TEST 38 38 #include <string.h> 39 39 #include <ctype.h> -
trunk/lib/ubasic/ubasic.c
r826 r846 35 35 #endif 36 36 37 #ifdef TEST37 #ifdef UBASIC_TEST 38 38 #include "../../include/ubasic.h" 39 39 #include "../../include/platform.h" 40 40 #include "../../include/script.h" 41 #include "../../include/shot_histogram.h" 41 42 #include "../../include/levent.h" 42 43 #include <string.h> 44 #include <time.h> 43 45 #include <fcntl.h> 44 46 #include <io.h> 47 #include <stdlib.h> /* rand,srand */ 45 48 #else 46 49 #include "ubasic.h" … … 48 51 #include "script.h" 49 52 #include "camera.h" 53 #include "shot_histogram.h" 54 #include "stdlib.h" 50 55 #include "levent.h" 51 56 #endif 52 //#include "platform.h"53 57 #include "tokenizer.h" 54 #include "shot_histogram.h" 58 59 55 60 #include "../../include/conf.h" 56 61 57 62 #include "camera_functions.h" 58 63 59 #include "stdlib.h" /* exit() */60 64 61 65 #define INCLUDE_OLD_GET__SYNTAX … … 244 248 case TOKENIZER_GET_SCRIPT_AUTOSTART: 245 249 accept(TOKENIZER_GET_SCRIPT_AUTOSTART); 250 #ifdef UBASIC_TEST 251 r = 0; 252 #else 246 253 r = conf.script_startup; 254 #endif 247 255 break; 248 256 case TOKENIZER_GET_USB_POWER: … … 467 475 } 468 476 break; 469 case TOKENIZER_GET_TIME: 477 case TOKENIZER_GET_TIME: { 470 478 accept(TOKENIZER_GET_TIME); 471 unsigned long t2 = time(NULL); 472 int time = expr(); 473 static struct tm *ttm; 474 ttm = localtime(&t2); 475 if (time==0) r = ttm->tm_sec; 476 else if (time==1) r = ttm->tm_min; 477 else if (time==2) r = ttm->tm_hour; 478 else if (time==3) r = ttm->tm_mday; 479 else if (time==4) r = ttm->tm_mon+1; 480 else if (time==5) r = 1900+ttm->tm_year; 481 break; 479 unsigned long t2 = time(NULL); 480 int tmode = expr(); 481 static struct tm *ttm; 482 ttm = localtime(&t2); 483 if (tmode==0) r = ttm->tm_sec; 484 else if (tmode==1) r = ttm->tm_min; 485 else if (tmode==2) r = ttm->tm_hour; 486 else if (tmode==3) r = ttm->tm_mday; 487 else if (tmode==4) r = ttm->tm_mon+1; 488 else if (tmode==5) r = 1900+ttm->tm_year; 489 break; 490 } 482 491 case TOKENIZER_GET_RAW: 483 492 accept(TOKENIZER_GET_RAW); 493 #ifdef UBASIC_TEST 494 r = 1; 495 #else 484 496 r = conf.save_raw; 497 #endif 485 498 break; 486 499 default: … … 1869 1882 accept(TOKENIZER_SET_SCRIPT_AUTOSTART); 1870 1883 to = expr(); 1884 #ifndef UBASIC_TEST 1871 1885 if (to >= 0 && to <= 2) conf.script_startup=to; 1872 1886 conf_save(); 1887 #endif 1873 1888 accept_cr(); 1874 1889 }
Note: See TracChangeset
for help on using the changeset viewer.