You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by GitBox <gi...@apache.org> on 2017/11/28 19:20:30 UTC

[GitHub] mkiiskila closed pull request #682: Remove apps/fat2native. This does not build, and has not been

mkiiskila closed pull request #682: Remove apps/fat2native. This does not build, and has not been
URL: https://github.com/apache/mynewt-core/pull/682
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/apps/fat2native/pkg.yml b/apps/fat2native/pkg.yml
deleted file mode 100644
index 0fccc233d..000000000
--- a/apps/fat2native/pkg.yml
+++ /dev/null
@@ -1,33 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-# 
-#  http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-pkg.name: apps/fat2native
-pkg.type: app
-pkg.description: Support application for debugging the FAT File System.
-pkg.author: "Apache Mynewt <de...@mynewt.apache.org>"
-pkg.homepage: "http://mynewt.apache.org/"
-pkg.keywords:
-
-pkg.deps:
-    - fs/fatfs
-    - hw/hal
-    - sys/console/full
-    - sys/log/full
-    - sys/stats/stub
-    - kernel/os
diff --git a/apps/fat2native/src/main.c b/apps/fat2native/src/main.c
deleted file mode 100644
index 00e281b02..000000000
--- a/apps/fat2native/src/main.c
+++ /dev/null
@@ -1,157 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#include <stdio.h>
-#include <unistd.h>
-#include <stdlib.h>
-
-#include <sysinit/sysinit.h>
-#include <fs/fs.h>
-
-#ifdef ARCH_sim
-#include <mcu/mcu_sim.h>
-#endif
-
-#include <fatfs/ff.h>
-#include <fs/fs_if.h>
-
-extern const struct fs_ops *fs_root_ops;
-static const char *progname;
-
-static void
-usage(int rc)
-{
-    printf("%s [-h][-f image_file]\n", progname);
-    printf("  Tool for operating on simulator flash image file\n");
-    printf("   -f: flash_file is the name of the flash image file\n");
-    exit(rc);
-}
-
-int
-main(int argc, char **argv)
-{
-    int ch;
-    FATFS fs;
-    FATFS *p_fs;
-    DWORD fre_clust, fre_sect, tot_sect;
-    FRESULT res;
-    struct fs_dir *dir;
-    struct fs_dirent *dirent;
-    struct fs_file *file;
-    char out_name[80];
-    uint8_t u8_len;
-    uint32_t u32_len;
-    int rc;
-    uint8_t buf[32];
-    static const BYTE ft[] = {0, 12, 16, 32};
-
-    progname = argv[0];
-
-    while ((ch = getopt(argc, argv, "f:v")) != -1) {
-        switch (ch) {
-        case 'f':
-            native_flash_file = optarg;
-            break;
-        case '?':
-        case 'h':
-        default:
-            usage(0);
-        }
-    }
-
-    sysinit();
-
-    /* TODO:
-     * log_register("fatfs-log", &nffs_log, &log_console_handler, NULL, LOG_SYSLEVEL);
-     */
-
-    f_mount(&fs, "0:", 0);
-
-    /* Get volume information and free clusters of drive 1 */
-    res = f_getfree("0:", &fre_clust, &p_fs);
-    if (res) {
-        printf("f_getfree() failed %d\n", res);
-        exit(1);
-    }
-
-    printf("\nFAT type = FAT%u\n"
-           "Number of FATs = %u\n"
-           "Root DIR entries = %u\n"
-           "Sectors/FAT = %lu\n"
-           "Volume start = %lu\n"
-           "FAT start = %lu\n"
-           "DIR start = %lu\n"
-           "Data start = %lu\n\n",
-        ft[p_fs->fs_type & 3], p_fs->n_fats, p_fs->n_rootdir, p_fs->fsize,
-        p_fs->volbase, p_fs->fatbase, p_fs->dirbase, p_fs->database);
-
-    /* Print the free space (assuming 512 bytes/sector) */
-
-    tot_sect = (p_fs->n_fatent - 2) * p_fs->csize;
-    fre_sect = fre_clust * p_fs->csize;
-
-    printf("%8lu KiB total drive space.\n"
-           "%8lu KiB available.\n",
-           tot_sect / 2, fre_sect / 2);
-
-    /* List contents of root directory */
-
-    rc = fs_root_ops->f_opendir("0:/", &dir);
-    if (rc != FS_EOK) {
-        printf("f_opendir() failed %d\n", rc);
-        exit(1);
-    }
-
-    printf("\nListing 0:/\n");
-
-    while (1) {
-        rc = fs_root_ops->f_readdir(dir, &dirent);
-        if (rc == FS_ENOENT) {
-            break;
-        } else if (rc != FS_EOK) {
-            printf("f_readdir() failed %d\n", rc);
-            exit(1);
-        }
-
-        rc = fs_root_ops->f_dirent_name(dirent, sizeof(out_name), out_name, &u8_len);
-        printf("%s\n", out_name);
-    }
-
-    fs_root_ops->f_closedir(dir);
-
-    /* If a README.txt exists, print contents */
-    rc = fs_root_ops->f_open("0:/README.txt", FS_ACCESS_READ, &file);
-    if (rc == FS_EOK) {
-        printf("\nREADME.txt found, showing contents:\n\n");
-        printf("------------------------------------------------\n");
-
-        while (1) {
-            rc = fs_root_ops->f_read(file, sizeof(buf), buf, &u32_len);
-            printf("%s\n", buf);
-            if (u32_len != 32) {
-                break;
-            }
-        }
-
-        printf("------------------------------------------------\n");
-        fs_root_ops->f_close(file);
-    }
-
-    return 0;
-}


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services