blob: 898123821ed7e0532a7c6a900c3cc5e63c1e9e13 [file] [log] [blame]
Stéphane Marchesinae37e6c2014-08-08 18:19:40 -07001/*
2 * Copyright (c) 2014 The Chromium OS Authors. All rights reserved.
3 * Use of this source code is governed by a BSD-style license that can be
4 * found in the LICENSE file.
5 */
6
7#include <libtsm.h>
8#include <stdio.h>
9#include <stdlib.h>
10#include <unistd.h>
11
Stéphane Marchesinae37e6c2014-08-08 18:19:40 -070012#include "input.h"
13#include "term.h"
14#include "video.h"
15
16int main()
17{
Stéphane Marchesinaf4423b2014-08-13 16:39:24 -070018 int32_t width, height, pitch, scaling;
Stéphane Marchesinae37e6c2014-08-08 18:19:40 -070019 int ret;
20
Stéphane Marchesinaf4423b2014-08-13 16:39:24 -070021 ret = video_init(&width, &height, &pitch, &scaling);
Stéphane Marchesinae37e6c2014-08-08 18:19:40 -070022 if (ret) {
23 printf("Video init failed\n");
24 return EXIT_FAILURE;
25 }
26
27 ret = input_init();
28 if (ret) {
29 printf("Input init failed\n");
30 video_close();
31 return EXIT_FAILURE;
32 }
33
Stéphane Marchesinaf4423b2014-08-13 16:39:24 -070034 ret = term_init(width, height, pitch, scaling);
Stéphane Marchesinae37e6c2014-08-08 18:19:40 -070035 if (ret) {
36 printf("Term init failed\n");
37 input_close();
38 video_close();
39 return EXIT_FAILURE;
40 }
41
42 ret = term_run();
43
44 input_close();
45 term_close();
46 video_close();
47
48 return ret;
49}