-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
25 changed files
with
201 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
spl_add_source(src/console_interface.c) | ||
spl_create_component() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#include "console_interface.h" | ||
|
||
void consoleInterface(void) { | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#ifndef __console_interface_h__ | ||
#define __console_interface_h__ | ||
|
||
#include "rte.h" | ||
|
||
void consoleInterface(void); | ||
|
||
#endif // __console_interface_h__ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
spl_add_source(src/keyboard_interface.c) | ||
spl_create_component() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#include "keyboard_interface.h" | ||
#include <windows.h> | ||
|
||
boolean isKeyPressed(int key) { | ||
if (GetAsyncKeyState(key)) { | ||
return TRUE; | ||
} else { | ||
return FALSE; | ||
} | ||
} | ||
|
||
void keyboardInterface(){ | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#ifndef __keyboard_interface_h__ | ||
#define __keyboard_interface_h__ | ||
|
||
#include "rte.h" | ||
|
||
void keyboardInterface(); | ||
|
||
#endif // __keyboard_interface_h__ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
spl_add_source(src/light_controller.c) | ||
spl_create_component() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#include "light_controller.h" | ||
#include "Rte.h" | ||
|
||
void lightController(void) { | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#ifndef __light_controller_h__ | ||
#define __light_controller_h__ | ||
|
||
void lightController(void); | ||
|
||
#endif // __light_controller_h__ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
include(parts.cmake) | ||
spl_add_source(src/main.c) | ||
spl_create_component() |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,12 @@ | ||
#include "autoconf.h" | ||
|
||
#if CONFIG_DUMMY_INTERFACE_DEFINED | ||
#include "component.h" | ||
extern int dummyInterface(void); | ||
#endif | ||
#include "spled.h" | ||
|
||
int main(void) { | ||
#if (CONFIG_DUMMY_INTERFACE_DEFINED) | ||
return dummyInterface(); | ||
#else | ||
|
||
while (1) | ||
{ | ||
spled(); | ||
} | ||
|
||
return 0; | ||
#endif | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
spl_add_source(src/power_signal_processing.c) | ||
spl_create_component() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#include "power_signal_processing.h" | ||
#include "Rte.h" | ||
|
||
// Function to check if "P" key was pressed and toggle power accordingly | ||
void powerSignalProcessing(void) { | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#ifndef __power_signal_processing_h__ | ||
#define __power_signal_processing_h__ | ||
|
||
void powerSignalProcessing(void); | ||
|
||
#endif // __power_signal_processing_h__ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
spl_add_source(src/rte.c) | ||
spl_create_component() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#include "rte.h" | ||
|
||
// Internal variable to hold the power state | ||
static PowerState currentPowerState = POWER_STATE_OFF; | ||
static boolean powerKeyPressed = FALSE; | ||
static int lightValue = 0; | ||
|
||
void RteSetPowerState(PowerState state) { | ||
currentPowerState = state; | ||
} | ||
|
||
PowerState RteGetPowerState(void) { | ||
return currentPowerState; | ||
} | ||
|
||
void RteSetPowerKeyPressed(boolean value) { | ||
powerKeyPressed = value; | ||
} | ||
|
||
boolean RteGetPowerKeyPressed() { | ||
return powerKeyPressed; | ||
} | ||
|
||
void RteSetLightValue(int value) { | ||
lightValue = value; | ||
} | ||
|
||
int RteGetLightValue(void) { | ||
return lightValue; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#ifndef __rte_h__ | ||
#define __rte_h__ | ||
|
||
// Define type for boolean | ||
typedef unsigned char boolean; | ||
#define TRUE 1 | ||
#define FALSE 0 | ||
|
||
// Define the PowerState type | ||
typedef enum { | ||
POWER_STATE_OFF = 0, | ||
POWER_STATE_ON = 1 | ||
} PowerState; | ||
|
||
void RteSetPowerState(PowerState state); | ||
PowerState RteGetPowerState(void); | ||
|
||
boolean RteGetPowerKeyPressed(); | ||
void RteSetPowerKeyPressed(boolean value); | ||
|
||
void RteSetLightValue(int value); | ||
int RteGetLightValue(void); | ||
|
||
#endif // __rte_h__ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
spl_add_source(src/spled.c) | ||
spl_create_component() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#include <stdio.h> | ||
|
||
#include "spled.h" | ||
|
||
#include "keyboard_interface.h" | ||
#include "power_signal_processing.h" | ||
#include "light_controller.h" | ||
#include "console_interface.h" | ||
|
||
void spled(void) { | ||
keyboardInterface(); | ||
powerSignalProcessing(); | ||
lightController(); | ||
consoleInterface(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#ifndef __spled_h__ | ||
#define __spled_h__ | ||
|
||
void spled(void); | ||
|
||
#endif // __spled_h__ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
set(CMAKE_TOOLCHAIN_FILE tools/toolchains/gcc/toolchain.cmake CACHE PATH "toolchain file") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
|
||
# | ||
# SPL Extensions | ||
# | ||
|
||
# | ||
# ZIP extension | ||
# | ||
CONFIG_ZIP_FEATURE=n | ||
CONFIG_ZIP_TOOL_VERSION="1.0.2" | ||
# end of ZIP extension | ||
# end of SPL Extensions | ||
|
||
# | ||
# Linking | ||
# | ||
CONFIG_LINKER_OUTPUT_FILE="my_main.exe" | ||
CONFIG_LINKER_BYPRODUCTS_EXTENSIONS="map" | ||
# end of Linking | ||
|
||
# | ||
# Feature Model | ||
# | ||
CONFIG_USE_COMPONENT_A_INTERFACE=y | ||
# CONFIG_USE_COMPONENT_B_INTERFACE is not set | ||
CONFIG_DUMMY_INTERFACE_DEFINED=y | ||
CONFIG_PART_NUMBER="PN0013" | ||
# end of Feature Model |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
spl_add_component(src/main) | ||
spl_add_component(src/rte) | ||
spl_add_component(src/spled) | ||
spl_add_component(src/power_signal_processing) | ||
spl_add_component(src/light_controller) | ||
spl_add_component(src/keyboard_interface) | ||
spl_add_component(src/console_interface) |