Skip to content

Commit

Permalink
First commit
Browse files Browse the repository at this point in the history
  • Loading branch information
nedex committed Apr 5, 2020
1 parent 62aba15 commit 25688df
Show file tree
Hide file tree
Showing 12 changed files with 532 additions and 143 deletions.
6 changes: 1 addition & 5 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@

build/

*.ovl

*.elf

*.nacp

*.nro
*.out
84 changes: 38 additions & 46 deletions .vscode/c_cpp_properties.json
Original file line number Diff line number Diff line change
@@ -1,48 +1,40 @@
{
"configurations": [
{
"name": "DKP Aarch64 Windows",
"includePath": [
"C:/devkitPro/devkitA64/aarch64-none-elf/include/**",
"C:/devkitPro/devkitA64/lib/gcc/aarch64-none-elf/8.3.0/include/**",
"C:/devkitPro/libnx/include/**",
"C:/devkitPro/portlibs/switch/include/**",
"C:/devkitPro/portlibs/switch/include/freetype2/**",
"${workspaceFolder}/include/**",
"${workspaceFolder}/libs/libtesla/include/**"
],
"defines": [
"SWITCH",
"__SWITCH__",
"__aarch64__"
],
"compilerPath": "C:/devkitPro/devkitA64/bin/aarch64-none-elf-g++",
"cStandard": "c11",
"cppStandard": "c++17",
"intelliSenseMode": "gcc-x64"
},
{
"name": "DKP Aarch64 Linux",
"includePath": [
"/opt/devkitpro/devkitA64/aarch64-none-elf/include/**",
"/opt/devkitpro/devkitA64/lib/gcc/aarch64-none-elf/8.3.0/include/**",
"/opt/devkitpro/libnx/include/**",
"/opt/devkitpro/portlibs/switch/include/**",
"/opt/devkitpro/portlibs/switch/include/**",
"/opt/devkitpro/portlibs/switch/include/freetype2/**",
"${workspaceFolder}/include/**",
"${workspaceFolder}/libs/libtesla/include/**"
],
"defines": [
"SWITCH",
"__SWITCH__",
"__aarch64__"
],
"compilerPath": "/opt/devkitpro/devkitA64/bin/aarch64-none-elf-g++",
"cStandard": "c11",
"cppStandard": "c++17",
"intelliSenseMode": "gcc-x64"
}
],
"version": 4
"configurations": [
{
"name": "DKP Aarch64 Windows",
"includePath": [
"C:/devkitPro/devkitA64/aarch64-none-elf/include/**",
"C:/devkitPro/devkitA64/lib/gcc/aarch64-none-elf/8.3.0/include/**",
"C:/devkitPro/libnx/include/**",
"C:/devkitPro/portlibs/switch/include/**",
"C:/devkitPro/portlibs/switch/include/freetype2/**",
"${workspaceFolder}/include/**",
"${workspaceFolder}/libs/libtesla/include/**"
],
"defines": ["SWITCH", "__SWITCH__", "__aarch64__"],
"compilerPath": "C:/devkitPro/devkitA64/bin/aarch64-none-elf-g++",
"cStandard": "c11",
"cppStandard": "c++17",
"intelliSenseMode": "gcc-x64"
},
{
"name": "DKP Aarch64 Linux",
"includePath": [
"/opt/devkitpro/devkitA64/aarch64-none-elf/include/**",
"/opt/devkitpro/devkitA64/lib/gcc/aarch64-none-elf/8.3.0/include/**",
"/opt/devkitpro/libnx/include/**",
"/opt/devkitpro/portlibs/switch/include/**",
"/opt/devkitpro/portlibs/switch/include/**",
"/opt/devkitpro/portlibs/switch/include/freetype2/**",
"${workspaceFolder}/include/**",
"${workspaceFolder}/libs/libtesla/include/**"
],
"defines": ["SWITCH", "__SWITCH__", "__aarch64__"],
"compilerPath": "/opt/devkitpro/devkitA64/bin/aarch64-none-elf-g++",
"cStandard": "c11",
"cppStandard": "c++17",
"intelliSenseMode": "gcc-x64"
}
],
"version": 4
}
3 changes: 3 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"recommendations": ["ms-vscode.cpptools"]
}
118 changes: 62 additions & 56 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,57 +1,63 @@
{
"files.associations": {
"chrono": "cpp",
"string_view": "cpp",
"array": "cpp",
"atomic": "cpp",
"bit": "cpp",
"*.tcc": "cpp",
"cctype": "cpp",
"clocale": "cpp",
"cmath": "cpp",
"cstdarg": "cpp",
"cstddef": "cpp",
"cstdint": "cpp",
"cstdio": "cpp",
"cstdlib": "cpp",
"cstring": "cpp",
"ctime": "cpp",
"cwchar": "cpp",
"cwctype": "cpp",
"deque": "cpp",
"unordered_map": "cpp",
"vector": "cpp",
"exception": "cpp",
"algorithm": "cpp",
"functional": "cpp",
"iterator": "cpp",
"memory": "cpp",
"memory_resource": "cpp",
"numeric": "cpp",
"optional": "cpp",
"random": "cpp",
"ratio": "cpp",
"string": "cpp",
"system_error": "cpp",
"tuple": "cpp",
"type_traits": "cpp",
"utility": "cpp",
"fstream": "cpp",
"initializer_list": "cpp",
"iosfwd": "cpp",
"istream": "cpp",
"limits": "cpp",
"new": "cpp",
"ostream": "cpp",
"sstream": "cpp",
"stdexcept": "cpp",
"streambuf": "cpp",
"thread": "cpp",
"cinttypes": "cpp",
"typeinfo": "cpp",
"codecvt": "cpp",
"condition_variable": "cpp",
"iomanip": "cpp",
"mutex": "cpp"
}
}
"files.associations": {
"chrono": "cpp",
"string_view": "cpp",
"array": "cpp",
"atomic": "cpp",
"bit": "cpp",
"*.tcc": "cpp",
"cctype": "cpp",
"clocale": "cpp",
"cmath": "cpp",
"cstdarg": "cpp",
"cstddef": "cpp",
"cstdint": "cpp",
"cstdio": "cpp",
"cstdlib": "cpp",
"cstring": "cpp",
"ctime": "cpp",
"cwchar": "cpp",
"cwctype": "cpp",
"deque": "cpp",
"unordered_map": "cpp",
"vector": "cpp",
"exception": "cpp",
"algorithm": "cpp",
"functional": "cpp",
"iterator": "cpp",
"memory": "cpp",
"memory_resource": "cpp",
"numeric": "cpp",
"optional": "cpp",
"random": "cpp",
"ratio": "cpp",
"string": "cpp",
"system_error": "cpp",
"tuple": "cpp",
"type_traits": "cpp",
"utility": "cpp",
"fstream": "cpp",
"initializer_list": "cpp",
"iosfwd": "cpp",
"istream": "cpp",
"limits": "cpp",
"new": "cpp",
"ostream": "cpp",
"sstream": "cpp",
"stdexcept": "cpp",
"streambuf": "cpp",
"thread": "cpp",
"cinttypes": "cpp",
"typeinfo": "cpp",
"codecvt": "cpp",
"condition_variable": "cpp",
"iomanip": "cpp",
"mutex": "cpp",
"list": "cpp",
"map": "cpp",
"iostream": "cpp"
},
"C_Cpp.clang_format_fallbackStyle": "{ BasedOnStyle: LLVM, UseTab: Never, IndentWidth: 4, TabWidth: 4, BreakBeforeBraces: Attach, AllowShortIfStatementsOnASingleLine: false, IndentCaseLabels: false, ColumnLimit: 0, AccessModifierOffset: -4, PointerAlignment: Left }",
"editor.formatOnSave": true,
"files.insertFinalNewline": true
}
20 changes: 20 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "Make",
"type": "shell",
"command": "make clean && make",
"problemMatcher": "$gcc",
"group": {
"kind": "build",
"isDefault": true
}
},
{
"label": "Make clean",
"type": "shell",
"command": "make clean"
}
]
}
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ include $(DEVKITPRO)/libnx/switch_rules
# of a homebrew executable (.nro). This is intended to be used for sysmodules.
# NACP building is skipped as well.
#---------------------------------------------------------------------------------
APP_TITLE := Tesla Overlay Template
APP_TITLE := QuickNTP
APP_VERSION := 1.0.0

TARGET := $(notdir $(CURDIR))
Expand Down
37 changes: 35 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,35 @@
# Tesla-Template
A template repository for Tesla Overlay Homebrews
# QuickNTP

Syncs the Nintendo Switch time with a list of NTP Servers.

![Preview](https://user-images.githubusercontent.com/389887/78499263-e9fcc500-774f-11ea-9392-60bd19d21ad8.jpg)

## Features

- Update the time by selecting from a list of servers
- Show the current offset against the selected server

## Motivation

Using a custom DNS it's not possible to sync the time with Nintendo's servers, and the Switch appears to gain some minutes each month.

## Possible future features

- Better error handling / messages
- Show a clock with seconds
- Turn the heart icon in a clock (have to check for the font)
- Get the time in a separated thread
- Pick the closest NTP server based on user region
- Update the time with milliseconds (maybe a system limitation)

## Credit

- [@3096] for SwitchTime who gave me the initial idea and some code examples
- [@thedax] for NX-ntpc, used by [@3096]
- [@WerWolv] for libtesla
- [NTP Pool Project](https://www.ntppool.org)

## Disclaimer

- Please don't send a lot of requests. NTP servers should be requested in 36 hours intervals
- This program changes NetworkSystemClock, which may cause a desync between console and servers. Use at your own risk! It is recommended that you only use the changed clock while offline, and change it back as soon as you are connected (either manually or using ntp.org server.)
2 changes: 1 addition & 1 deletion libs/libtesla

0 comments on commit 25688df

Please sign in to comment.