source: examples-v2/file_io/crc/init.c @ f15676f

Last change on this file since f15676f was f15676f, checked in by Joel Sherrill <joel@…>, on Oct 12, 2017 at 7:10:44 PM

Make crc and fdopen build

Updates #3158.

  • Property mode set to 100644
File size: 1.5 KB
Line 
1/*
2 *  COPYRIGHT (c) 1989-2011.
3 *  On-Line Applications Research Corporation (OAR).
4 *
5 *  The license and distribution terms for this file may be
6 *  found in the file LICENSE in this distribution or at
7 *  http://www.rtems.com/license/LICENSE.
8 */
9
10
11
12#include <rtems.h>
13#include <bsp.h>
14
15#include <stdio.h>
16#include <stdlib.h>
17
18#include "fs-root-tar.h"
19#include <rtems/untar.h>
20
21/* sha-specific includes */
22#include <string.h>
23#include <time.h>
24#include "crc.h"
25#include <errno.h>
26
27rtems_task Init(
28  rtems_task_argument ignored
29)
30{
31  char in_file[20] = "/image.img";
32  DWORD crc;
33  long charcnt;
34
35  puts( "\n\n*** untar/imfs/crc example ***" );
36
37  printf("Unpacking tar filesystem\nThis may take awhile...\n");
38  if(Untar_FromMemory((char*) fs_root_tar, fs_root_tar_size) != 0) {
39    printf("Can't unpack tar filesystem\n");
40    exit(1);
41  }
42
43  crc32file(in_file,&crc, &charcnt);
44  printf("%08lX %7ld %s\n", crc, charcnt, in_file);
45
46  printf( "*** end of demonstration ***\n" );
47  exit( 0 );
48}
49
50/* configuration */
51/* drivers */
52#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
53#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
54
55/* filesystem */
56#define CONFIGURE_USE_IMFS_AS_BASE_FILESYSTEM
57#define CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS 40
58#define CONFIGURE_IMFS_MEMFILE_BYTES_PER_BLOCK 512
59
60/* tasks */
61#define CONFIGURE_MAXIMUM_TASKS             4
62#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
63#define CONFIGURE_EXTRA_TASK_STACKS         (3 * RTEMS_MINIMUM_STACK_SIZE)
64
65#define CONFIGURE_INIT
66#include <rtems/confdefs.h>
67/* end of file */
Note: See TracBrowser for help on using the repository browser.