Project

General

Profile

Statistics
| Revision:

root / lab2 / lab2.c @ 5

History | View | Annotate | Download (1.35 KB)

1 4 up20180655
#include <lcom/lcf.h>
2
#include <lcom/lab2.h>
3
4
#include <stdbool.h>
5
#include <stdint.h>
6
7
8
int main(int argc, char *argv[]) {
9
  // sets the language of LCF messages (can be either EN-US or PT-PT)
10
  lcf_set_language("EN-US");
11
12
  // enables to log function invocations that are being "wrapped" by LCF
13
  // [comment this out if you don't want/need it]
14
  lcf_trace_calls("/home/lcom/labs/lab2/trace.txt");
15
16
  // enables to save the output of printf function calls on a file
17
  // [comment this out if you don't want/need it]
18
  lcf_log_output("/home/lcom/labs/lab2/output.txt");
19
20
  // handles control over to LCF
21
  // [LCF handles command line arguments and invokes the right function]
22
  if (lcf_start(argc, argv))
23
    return 1;
24
25
  // LCF clean up tasks
26
  // [must be the last statement before return]
27
  lcf_cleanup();
28
29
  return 0;
30
}
31
32
int(timer_test_read_config)(uint8_t timer, enum timer_status_field field) {
33 5 up20180642
    /* To be implemented by the students */
34 4 up20180655
35 5 up20180642
    uint8_t state = 0;
36
    if(timer_get_conf(timer, &state)) return 1;
37
    //printf("%x\n", state);
38
39
    return 0;
40 4 up20180655
}
41
42
int(timer_test_time_base)(uint8_t timer, uint32_t freq) {
43
  /* To be implemented by the students */
44
  printf("%s is not yet implemented!\n", __func__);
45
46
  return 1;
47
}
48
49
int(timer_test_int)(uint8_t time) {
50
  /* To be implemented by the students */
51
  printf("%s is not yet implemented!\n", __func__);
52
53
  return 1;
54
}