Showing posts with label GENERAL. Show all posts
Showing posts with label GENERAL. Show all posts

Thursday, November 29, 2012

Compiled i8320 kernel, let it support multi-touch

Compile the kernel:

But inside there is a wrong place:
CONFIG_KPL can not be canceled, the cancellation will cause dcm module can not be loaded, unable to control the led brightness.
Compile KPL need to add include directories:
CFLAGS_KERNEL =-march = armv7-a -I./drivers/txsr/Inc

Multi-point:
the i8320 kernel version and tinyx version does not support the now popular MT. There are several ways to solve this problem.
1) Upgrade the the kernel input section, upgrade tinyx. (A lot of work needs to be done)
2) to drive the dual mouse mode (current version supports the driver compiled into a loadable module, in order to debug. Difficult, who has the time to try)
3) change the drive, and direct access to the application. (30 minutes to get the method currently gba0.7 used)

Increase in sysfs inside a directory directtouchop, applications to directly read
static DEVICE_ATTR (directtouchop, S_IRUGO | S_IWUSR, direct_touch_show, direct_touch_store);

Directly read the driver source code:

For details, please point:
http://blog.csdn.net/mdjerry/archive/2010/10/20/5954595.aspx

Camera header files, flash control source and flashlight ipk

A flashlight program recently in order to put forward a flashlight, specially rebuilt according to the API mmfcamcoder.h and some of the header files, along with control of the source of the flash, and do a good job for you greatly to continue to study

Fever too big ah flashlight Do not drive too long Oh, be careful, first off you put twists, burning JJ peril

Flashlight:

Header file:

Source:
Turn on the camera:
  1. MMHandleType handler = 0, attr;
  2. MMCamPreset cp;
  3. cp.videodev_type = MM_VIDEO_DEVICE_CAMERA0; / / camera0 on behalf of the main camera
  4. int c = MMCamcorderCreate (& handler, & cp); / / Create a handler
  5. fprintf (stderr, "create [% d] \ n", c);

  6. / / Get the handler the strobe attributes enumeration, and assigned to the attr
  7. MMCamcorderGetAttrs (handler, MM_CAMCORDER_ATTR_STROBE, & attr);
  8. fprintf (stderr, "attr [% d] \ n", attr);

  9. int r = MMCamcorderRealize (handler); / / initialize handler
  10. fprintf (stderr, "Realize [% d] \ n", r);

  11. / / From attr obtain the strobe property control, and set FLASH_MOVIE_ON
  12. / / Set FLASH_OFF said Close, FLASH_ON and FLASH_AUTO are only flash, FLASH_MOVIE_ON long bright
  13. MMAttrsSetInt (attr, MM_CAMCORDER_STROBE_CONTROL, MM_CAMCORDER_FLASH_MOVIE_ON);

  14. / / Set a good strobe attribute set back to the handler
  15. MMCamcorderSetAttrs (handler, MM_CAMCORDER_ATTR_STROBE, attr);

  16. / / Start camera preview preview state handler
  17. int s = MMCamcorderStart (handler);
  18. fprintf (stderr, "start [% d] \ n", s);

  19. / / This is where the real start shooting, open to little reaction time, so if you just open the flash, do not need this step
  20. / / Int cs = MMCamcorderCaptureStart (handler);
  21. / / Fprintf (stderr, "CaptureStart [% d] \ n", cs);
Turn off the camera:
  1. / / Close is turn you stop shooting
  2. / / Int css = MMCamcorderCaptureStop (handler);
  3. / / Fprintf (stderr, "CaptureStop [% d] \ n", css);

  4. / / Close the preview mode
  5. int ss = MMCamcorderStop (handler);
  6. fprintf (stderr, "Stop [% d] \ n", ss);

  7. / / Turn off the flash
  8. MMAttrsSetInt (attr, MM_CAMCORDER_STROBE_CONTROL, MM_CAMCORDER_FLASH_OFF);
  9. MMCamcorderSetAttrs (handler, MM_CAMCORDER_ATTR_STROBE, attr);

  10. / / Unrealize
  11. int ur = MMCamcorderUnrealize (handler);
  12. fprintf (stderr, "unrealize [% d] \ n", ur);

  13. / / Final destruction
  14. int d = MMCamcorderDestroy (handler);
  15. fprintf (stderr, "destroy [% d] \ n", d);