Skip to content

Commit

Permalink
o Code cleanup.
Browse files Browse the repository at this point in the history
  • Loading branch information
Mike Miller committed Nov 25, 2023
1 parent ce7aa7d commit 81989ac
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 11 deletions.
6 changes: 0 additions & 6 deletions app/RTCDevice.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,5 @@
//
// Created by Michael Miller on 11/22/23.
//
#include"fs/tty.h"

extern struct dev_ops rtc_dev;
extern int rtc_close(struct fd *fd);
extern ssize_t rtc_read(struct fd *fd, void *buf, size_t bufsize);
extern int rtc_ioctl(struct fd *fd, int cmd, void *arg);
extern int rtc_poll(struct fd *fd);
extern int rtc_open(int major, int minor, struct fd *fd);
7 changes: 2 additions & 5 deletions app/RTCDevice.m
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
// Real Time Clock file descriptor structure
typedef struct fd rtc_fd;

// Function to get the current time
// Need to define this, as we are running on iOS, which doesn't have/give access to the RTC
typedef struct rtc_time {
int tm_sec; // seconds
int tm_min; // minutes
Expand All @@ -18,6 +18,7 @@
int tm_year; // year
} rtc_time;

// Get the time, put it in the appropriate structure
static rtc_time *get_current_time(rtc_fd *fd, size_t *len) {
// Obtain the current date
NSDate *currentDate = [NSDate date];
Expand Down Expand Up @@ -51,22 +52,18 @@
}


// Read current time into buffer
static ssize_t rtc_read(rtc_fd *fd, void *buf, size_t bufsize) {
return 0;
}

// Polling is not needed for RTC, return 0
static int rtc_poll(rtc_fd *fd) {
return 0;
}

// Function to open the RTC device
static int rtc_open(int major, int minor, rtc_fd *fd) {
return 0;
}

// Function to close the RTC device
static int rtc_close(rtc_fd *fd) {
return 0;
}
Expand Down

0 comments on commit 81989ac

Please sign in to comment.