-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Restructured code, added GD32 compatibility code (not finished)
- Loading branch information
Showing
34 changed files
with
1,701 additions
and
378 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 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,11 +1,11 @@ | ||
[env:fs2011stm32] | ||
[env:fs2011] | ||
platform = ststm32 | ||
board = fs2011stm32 | ||
board = fs2011 | ||
framework = libopencm3 | ||
|
||
lib_compat_mode = off | ||
lib_deps = olikraus/U8g2@^2.34.17 | ||
|
||
build_flags = -DCHECK_FIRMWARE | ||
; build_flags = -DERROR_HANDLERS | ||
; build_flags = -DERROR_HANDLERS | ||
; build_flags = -DERROR_HANDLERS -DCHECK_FIRMWARE |
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
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 |
---|---|---|
|
@@ -28,7 +28,7 @@ enum GameState | |
GAME_UNDO_MOVE, | ||
}; | ||
|
||
struct Game | ||
struct | ||
{ | ||
uint8_t playerIndex; | ||
|
||
|
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 @@ | ||
/* | ||
* FS2011 Pro | ||
* GD32 firmware library fake header | ||
* | ||
* Parts: Copyright (c) 2022, GigaDevice Semiconductor Inc. | ||
*/ | ||
|
||
#include "gd32f1x0.h" | ||
|
||
#define OB_RDP (*((uint32_t *)0x1ffff800)) | ||
|
||
bool isGD32(void) | ||
{ | ||
return (OB_RDP & 0xff) == 0xa5; | ||
} |
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,50 @@ | ||
/* | ||
* FS2011 Pro | ||
* GD32 firmware library fake header | ||
* | ||
* Parts: Copyright (c) 2022, GigaDevice Semiconductor Inc. | ||
*/ | ||
|
||
#ifndef GD32F1X0_H | ||
#define GD32F1X0_H | ||
|
||
#include <stdbool.h> | ||
#include <stdint.h> | ||
|
||
#include "main.h" | ||
|
||
typedef enum | ||
{ | ||
DISABLE = 0, | ||
ENABLE = !DISABLE | ||
} EventStatus, | ||
ControlStatus; | ||
|
||
enum | ||
{ | ||
FALSE = 0, | ||
TRUE = !FALSE | ||
}; | ||
|
||
typedef enum | ||
{ | ||
RESET = 0, | ||
SET = !RESET | ||
} FlagStatus; | ||
|
||
typedef enum | ||
{ | ||
ERROR = 0, | ||
SUCCESS = !ERROR | ||
} ErrStatus; | ||
|
||
#define REG32(addr) (*(volatile uint32_t *)(uint32_t)(addr)) | ||
#define REG16(addr) (*(volatile uint16_t *)(uint32_t)(addr)) | ||
#define REG8(addr) (*(volatile uint8_t *)(uint32_t)(addr)) | ||
#define BIT(x) ((uint32_t)((uint32_t)0x01U << (x))) | ||
#define BITS(start, end) ((0xFFFFFFFFUL << (start)) & (0xFFFFFFFFUL >> (31U - (uint32_t)(end)))) | ||
#define GET_BITS(regval, start, end) (((regval)&BITS((start), (end))) >> (start)) | ||
|
||
bool isGD32(void); | ||
|
||
#endif |
Oops, something went wrong.