From ffe5e1d15cb4c566cccd6001ea2f8675828cf5fa Mon Sep 17 00:00:00 2001 From: citrusbolt Date: Tue, 31 Aug 2021 12:20:15 -0600 Subject: [PATCH] Remove unsued files --- source/led.c | 101 --------------------------------- source/led.h | 13 ----- source/util.c | 150 -------------------------------------------------- 3 files changed, 264 deletions(-) delete mode 100644 source/led.c delete mode 100644 source/led.h delete mode 100644 source/util.c diff --git a/source/led.c b/source/led.c deleted file mode 100644 index 28c32cc..0000000 --- a/source/led.c +++ /dev/null @@ -1,101 +0,0 @@ -#include "led.h" -#include -#include - -#include "util.h" - -// Breathing effect LED pattern -//static const HidsysNotificationLedPattern breathing_pattern = { -// .baseMiniCycleDuration = 0x8, // 100ms. -// .totalMiniCycles = 0x2, // 3 mini cycles. Last one 12.5ms. -// .totalFullCycles = 0x5, // 5 full cycles. -// .startIntensity = 0x2, // 13%. -// .miniCycles = { -// // First cycle -// { -// .ledIntensity = 0xF, // 100%. -// .transitionSteps = 0xF, // 15 steps. Transition time 1.5s. -// .finalStepDuration = 0x0, // 12.5ms. -// }, -// // Second cycle -// { -// .ledIntensity = 0x2, // 13%. -// .transitionSteps = 0xF, // 15 steps. Transition time 1.5s. -// .finalStepDuration = 0x0, // 12.5ms. -// }, -// }, -//}; -// -//// Double click LED pattern. -//static const HidsysNotificationLedPattern double_click_pattern = { -// .baseMiniCycleDuration = 0x6, // 75ms. -// .totalMiniCycles = 0x2, // 3 mini cycles. Last one 12.5ms. -// .totalFullCycles = 0x1, // 1 full cycle. -// .startIntensity = 0xF, // 100%. -// .miniCycles = { -// // First cycle -// { -// .ledIntensity = 0x0, // 0%. -// .transitionSteps = 0x0, // Instant transition time. -// .finalStepDuration = 0x0, // 12.5ms. -// }, -// // Second cycle -// { -// .ledIntensity = 0xF, // 100%. -// .transitionSteps = 0x0, // Instant transition time. -// .finalStepDuration = 0x1, // 75ms. -// }, -// }, -//}; -// -//// Single click LED pattern. -//static const HidsysNotificationLedPattern single_click_pattern = { -// .baseMiniCycleDuration = 0x8, // 100ms. -// .totalMiniCycles = 0x1, // 2 mini cycles. Last one 12.5ms. -// .totalFullCycles = 0x1, // 1 full cycle. -// .startIntensity = 0xF, // 100%. -// .miniCycles = { -// // First cycle -// { -// .ledIntensity = 0x0, // 0%. -// .transitionSteps = 0x5, // 3 steps. Transition time 0.5s. -// .finalStepDuration = 0x0, // 12.5ms. -// }, -// }, -//}; -// -//static void send_led_pattern(const HidsysNotificationLedPattern* pattern) -//{ -// s32 total_entries; -// u64 uniquePadIds[2]; -// -// Result rc = hidsysGetUniquePadsFromNpad(hidGetHandheldMode() ? CONTROLLER_HANDHELD : CONTROLLER_PLAYER_1, uniquePadIds, 2, &total_entries); -// if (R_FAILED(rc) && rc != MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer)) -// fatalThrow(rc); -// -// for (int i = 0; i < total_entries; i++) -// hidsysSetNotificationLedPattern(pattern, uniquePadIds[i]); -//} -// -//void flash_led_connect() -//{ -// send_led_pattern(&breathing_pattern); -//} -// -//void flash_led_disconnect() -//{ -// HidsysNotificationLedPattern pattern; -// memset(&pattern, 0, sizeof(pattern)); -// -// send_led_pattern(&pattern); -//} -// -//void flash_led_pause() -//{ -// send_led_pattern(&double_click_pattern); -//} -// -//void flash_led_unpause() -//{ -// send_led_pattern(&single_click_pattern); -//} diff --git a/source/led.h b/source/led.h deleted file mode 100644 index fe2da85..0000000 --- a/source/led.h +++ /dev/null @@ -1,13 +0,0 @@ -#pragma once - -// Flash LED on FTP connect -void flash_led_connect(); - -// Flash LED on FTP disconnect -void flash_led_disconnect(); - -// Flash LED on FTP server pause -void flash_led_pause(); - -// Flash LED on FTP server unpause -void flash_led_unpause(); \ No newline at end of file diff --git a/source/util.c b/source/util.c deleted file mode 100644 index e8a956b..0000000 --- a/source/util.c +++ /dev/null @@ -1,150 +0,0 @@ -#include "util.h" -#include "led.h" -#include -#include -#include -#include -#include - -#include "minIni.h" -#include - -//static bool inputThreadRunning = true; -//static bool paused = false; -//static Mutex pausedMutex = 0; -//static Thread pauseThread; -//static HidControllerKeys comboKeys[8] = {}; - -//void inputPoller() -//{ -// do -// { -// hidScanInput(); -// u64 kHeld = 0; -// for (u8 controller = 0; controller != 10; controller++) -// kHeld |= hidKeysHeld(controller); -// -// u64 keyCombo = 0; -// for (u8 i = 0; i != sizearray(comboKeys); ++i) -// keyCombo |= comboKeys[i]; -// -// static bool keyComboPressed = false; -// -// if ((kHeld & keyCombo) == keyCombo) -// { -// if (!keyComboPressed) -// { -// keyComboPressed = true; -// setPaused(!isPaused()); -// } -// } -// else -// { -// keyComboPressed = false; -// } -// svcSleepThread(1e+8); -// } while (inputThreadRunning); -//} -// -//const char* buttons[] = { -// "A", -// "B", -// "X", -// "Y", -// "LS", -// "RS", -// "L", -// "R", -// "ZL", -// "ZR", -// "PLUS", -// "MINUS", -// "DLEFT", -// "DUP", -// "DRIGHT", -// "DDOWN", -//}; -// -//HidControllerKeys GetKey(const char* text) -//{ -// for (u8 i = 0; i != sizearray(buttons); ++i) -// { -// if (strcmp(text, buttons[i]) == 0) -// { -// return BIT(i); -// } -// } -// return 0; -//} -// -//Result pauseInit() -//{ -// Result rc; -// mutexLock(&pausedMutex); -// -// FILE* should_pause_file = fopen("/config/sys-ftpd/ftpd_paused", "r"); -// if (should_pause_file != NULL) -// { -// paused = true; -// fclose(should_pause_file); -// } -// -// { -// char buffer[128]; -// ini_gets("Pause", "keycombo:", "PLUS+MINUS+X", buffer, 128, CONFIGPATH); -// char* token = strtok(buffer, "+ "); -// int i = 0; -// while (token != NULL && i != sizearray(comboKeys)) -// { -// comboKeys[i++] = GetKey(token); -// token = strtok(NULL, "+ "); -// }; -// } -// -// inputThreadRunning = true; -// -// rc = threadCreate(&pauseThread, inputPoller, NULL, NULL, 0x300, 0x3B, -2); -// if (R_FAILED(rc)) -// goto exit; -// -// rc = threadStart(&pauseThread); -// if (R_FAILED(rc)) -// goto exit; -// -//exit: -// mutexUnlock(&pausedMutex); -// return rc; -//} -// -//void pauseExit() -//{ -// inputThreadRunning = false; -// threadWaitForExit(&pauseThread); -// threadClose(&pauseThread); -//} -// -//bool isPaused() -//{ -// mutexLock(&pausedMutex); -// bool ret = paused; -// mutexUnlock(&pausedMutex); -// return ret; -//} -// -//void setPaused(bool newPaused) -//{ -// mutexLock(&pausedMutex); -// paused = newPaused; -// if (paused) -// { -// FILE* should_pause_file = fopen("/config/sys-ftpd/ftpd_paused", "w"); -// fclose(should_pause_file); -// flash_led_pause(); -// } -// else -// { -// unlink("/config/sys-ftpd/ftpd_paused"); -// flash_led_unpause(); -// } -// mutexUnlock(&pausedMutex); -//}