Changeset 18209


Ignore:
Timestamp:
10/12/12 20:21:48 (11 years ago)
Author:
obi
Message:

[titan] fix dauerspinner on titan start

Location:
titan/titan
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • titan/titan/global.h

    r18190 r18209  
    24502450}
    24512451
    2452 int setsaturation(int value)
    2453 {
    2454         debug(1000, "in");
    2455         char* saturationdev;
    2456 
    2457         saturationdev = getconfig("saturationdev", NULL);
    2458 
    2459         if(saturationdev != NULL)
    2460         {
    2461                 debug(100, "set %s to %d", saturationdev, value);
    2462                 return writesysint(saturationdev, value, 1);
    2463         }
    2464 
    2465         debug(1000, "out");
    2466         return 0;
    2467 }
    2468 
    2469 int setbrightness(int value)
    2470 {
    2471         debug(1000, "in");
    2472         char* brightnessdev;
    2473 
    2474         brightnessdev = getconfig("brightnessdev", NULL);
    2475 
    2476         if(brightnessdev != NULL)
    2477         {
    2478                 debug(100, "set %s to %d", brightnessdev, value);
    2479                 return writesysint(brightnessdev, value, 1);
    2480         }
    2481 
    2482         debug(1000, "out");
    2483         return 0;
    2484 }
    2485 
    24862452int setvmpeg(struct dvbdev* node, int posx, int posy, int width, int height)
    24872453{
     
    25862552}
    25872553
     2554int checkdev(char* dev)
     2555{
     2556        char* cmd = NULL;
     2557        cmd = ostrcat(cmd, "cat ", 1, 0);
     2558        cmd = ostrcat(cmd, dev, 1, 0);
     2559
     2560        char* tmpstr = NULL;
     2561        tmpstr = string_newline(command(cmd));
     2562        free(cmd), cmd = NULL;
     2563
     2564        if(tmpstr == NULL)
     2565        {
     2566                return 0;
     2567        }
     2568
     2569        if(ostrcmp(tmpstr, "Segmentation fault") == 0)
     2570        {
     2571                return 0;
     2572        }
     2573       
     2574        free(tmpstr), tmpstr = NULL;
     2575        return 1;
     2576}
     2577
     2578int setsaturation(int value)
     2579{
     2580        debug(1000, "in");
     2581        char* saturationdev;
     2582
     2583        saturationdev = getconfig("saturationdev", NULL);
     2584
     2585        if(saturationdev != NULL && checkdev(saturationdev))
     2586        {
     2587                debug(100, "set %s to %d", saturationdev, value);
     2588                return writesysint(saturationdev, value, 1);
     2589        }
     2590
     2591        debug(1000, "out");
     2592        return 0;
     2593}
     2594
     2595int setbrightness(int value)
     2596{
     2597        debug(1000, "in");
     2598        char* brightnessdev;
     2599
     2600        brightnessdev = getconfig("brightnessdev", NULL);
     2601
     2602        if(brightnessdev != NULL && checkdev(brightnessdev))
     2603        {
     2604                debug(100, "set %s to %d", brightnessdev, value);
     2605                return writesysint(brightnessdev, value, 1);
     2606        }
     2607
     2608        debug(1000, "out");
     2609        return 0;
     2610}
     2611
    25882612int setcontrast(int value)
    25892613{
     
    25932617        contrastdev = getconfig("contrastdev", NULL);
    25942618
    2595         if(contrastdev != NULL)
     2619        if(contrastdev != NULL && checkdev(contrastdev))
    25962620        {
    25972621                debug(100, "set %s to %d", contrastdev, value);
     
    26102634        tintdev = getconfig("tintdev", NULL);
    26112635
    2612         if(tintdev != NULL)
     2636        if(tintdev != NULL && checkdev(tintdev))
    26132637        {
    26142638                debug(100, "set %s to %d", tintdev, value);
  • titan/titan/header.h

    r18190 r18209  
    649649char* string_deltags(char* str);
    650650char* readfromlinetoline(char* str, int start, int end, int flag);
     651int checkdev(char* dev);
    651652
    652653//rcconfig.h
Note: See TracChangeset for help on using the changeset viewer.