Blame view

main.c 704 Bytes
e583b6a9   henyxia   First version
1
  #include <stdio.h>
cdaa873f   henyxia   Log fixed
2
  #include <pthread.h>
ae25085d   henyxia   Output function done
3
  #include "printx.h"
ea1218f1   henyxia   UI finished
4
  #include "ui.h"
3bdc9daf   henyxia   NFC Added
5
  #include "nfc.h"
e583b6a9   henyxia   First version
6
  
cdaa873f   henyxia   Log fixed
7
8
  #include <unistd.h>
  
e583b6a9   henyxia   First version
9
10
  int main(void)
  {
19082eeb   henyxia   UI design not wor...
11
  	int ret;
3bdc9daf   henyxia   NFC Added
12
  	pthread_t tUI, tNFC;//tHVC
ea1218f1   henyxia   UI finished
13
14
15
16
17
18
  	initUILog();
  	if(!initLog())
  	{
  		printf("Log creation failed\n");
  		return 1;
  	}
297a72df   henyxia   Added sender
19
20
  	printx(INFO, MAIN, "Tweekd starting\n");
  	printx(DEBUG, MAIN, "Creating processes\n");
ea1218f1   henyxia   UI finished
21
  	displayUI();
19082eeb   henyxia   UI design not wor...
22
  	ret = pthread_create(&tUI, NULL, drawUI, NULL);
297a72df   henyxia   Added sender
23
24
  	printx(DEBUG, MAIN, "UI Started ID %08x ret %d\n", tUI, ret);
  	printx(INFO, MAIN, "Initializing NFC");
3bdc9daf   henyxia   NFC Added
25
26
27
28
29
30
  	if(!initNFC())
  	{
  		printx(ERROR, MAIN, "Unable to start the NFC interface\n");
  		return 2;
  	}
  	pthread_create(&tNFC, NULL, processNFC, NULL);
cdaa873f   henyxia   Log fixed
31
  	pthread_join(tUI, NULL);
ae25085d   henyxia   Output function done
32
  	closeLog();
e583b6a9   henyxia   First version
33
34
  	return 0;
  }