forked from flipperdevices/video-game-module
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* first poc for rgb over rpc * get VgmMode over rpc * foreground and background can be rainbow now * Update protobuf * Remove unused function * Naming and sync from fw pr * Fix warnings * More unused stuff * Fallback to default when not custom color (eg OFW RPC) --------- Co-authored-by: Willy-JL <[email protected]>
- Loading branch information
Showing
7 changed files
with
118 additions
and
134 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
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
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,13 +1,49 @@ | ||
#pragma once | ||
#include <pico/stdlib.h> | ||
#include <FreeRTOS.h> | ||
#include <task.h> | ||
|
||
#include "frame.h" | ||
|
||
typedef union __attribute__((packed)) { | ||
struct { | ||
uint8_t r; | ||
uint8_t g; | ||
uint8_t b; | ||
}; | ||
uint32_t value : 24; | ||
} RgbColor; | ||
|
||
typedef enum { | ||
VgmColorModeDefault, | ||
VgmColorModeCustom, | ||
VgmColorModeRainbow, | ||
VgmColorModeRgbBacklight, | ||
VgmColorModeCount, | ||
} VgmColorMode; | ||
ScreenColorModeDefault, | ||
ScreenColorModeCustom, | ||
ScreenColorModeRainbow, | ||
_ScreenColorModeRgbBacklight, // FW will replace this with backlight mode | ||
ScreenColorModeCount, | ||
} ScreenColorMode; | ||
|
||
typedef union __attribute__((packed)) { | ||
struct { | ||
ScreenColorMode mode; | ||
RgbColor rgb; | ||
}; | ||
uint32_t value; | ||
} ScreenFrameColor; | ||
|
||
typedef struct { | ||
TaskHandle_t thread; | ||
size_t current_color_index; | ||
uint8_t totalSteps; | ||
uint8_t currentStep; | ||
void (*set_color)(uint16_t color); | ||
} State; | ||
|
||
extern State bg_state; | ||
|
||
extern State fg_state; | ||
|
||
uint16_t rgb888_to_rgb565(RgbColor rgb); | ||
|
||
void start_rainbow_mode(); | ||
void start_rainbow_mode(State* s); | ||
|
||
void stop_rainbow_mode(); | ||
void stop_rainbow_mode(State* s); |
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