The TISDK file system features some applications running on QT which allow
users find and run example programs easily through a friendly graphic
interface.
Note:
The system image supports 4.3" display by default. If you are working with a
display of another size, you need to modify the parameters in UBOOT. Please
refer to p56 for details.
6.10 Application Development
This section mainly introduces the development of application programs,
and illustrates the general process of application programs development
through examples.
6.10.1 Development example: LED application program
1. Composing Source Code
The following is led_acc.c source code; this instructs the three LEDs on the
development board to flash.
#include <stdio.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/ipc.h>
#include <sys/ioctl.h>
#include <fcntl.h>
#define LED1 "/sys/class/leds/sys_led/brightness"
#define LED2 "/sys/class/leds/user_led/brightness"
int main(int argc, char *argv[])
{
int f_led1, f_led2;
unsigned char i = 0;
unsigned char dat1, dat2;
if((f_led1 = open(LED1, O_RDWR)) < 0){
printf("error in open %s",LED1);
return -1;
}
if((f_led2 = open(LED2, O_RDWR)) < 0){
printf("error in open %s",LED2);
Page | 77