Compare commits

..

No commits in common. "58bea2f20a46f120f503273af1f098eacce6b494" and "fd34cbfc8a36a96d120e7b6a8226a27ac3dc8d95" have entirely different histories.

9 changed files with 70 additions and 33 deletions

View File

@ -177,9 +177,6 @@ class MRobotApp:
root.title("MRobot 自动生成脚本") root.title("MRobot 自动生成脚本")
root.geometry("800x600") # 调整窗口大小以适应布局 root.geometry("800x600") # 调整窗口大小以适应布局
# 在窗口关闭时调用 on_closing 方法
root.protocol("WM_DELETE_WINDOW", lambda: self.on_closing(root))
# 初始化 BooleanVar # 初始化 BooleanVar
self.add_gitignore_var = tk.BooleanVar(value=True) self.add_gitignore_var = tk.BooleanVar(value=True)

38
MRobot.spec Normal file
View File

@ -0,0 +1,38 @@
# -*- mode: python ; coding: utf-8 -*-
a = Analysis(
['MRobot.py'],
pathex=[],
binaries=[],
datas=[],
hiddenimports=[],
hookspath=[],
hooksconfig={},
runtime_hooks=[],
excludes=[],
noarchive=False,
optimize=0,
)
pyz = PYZ(a.pure)
exe = EXE(
pyz,
a.scripts,
a.binaries,
a.datas,
[],
name='MRobot',
debug=False,
bootloader_ignore_signals=False,
strip=False,
upx=True,
upx_exclude=[],
runtime_tmpdir=None,
console=False,
disable_windowed_traceback=False,
argv_emulation=False,
target_arch=None,
codesign_identity=None,
entitlements_file=None,
)

1
MRobot_repo Submodule

@ -0,0 +1 @@
Subproject commit 4539cfb332e1d96d7ac5b0d9c735a75900a2aa0c

View File

@ -1,4 +1,4 @@
#include "crc16_rm.h" #include "crc16.h"
static const uint16_t crc16_tab[256] = { static const uint16_t crc16_tab[256] = {
0x0000, 0x1189, 0x2312, 0x329b, 0x4624, 0x57ad, 0x6536, 0x74bf, 0x8c48, 0x0000, 0x1189, 0x2312, 0x329b, 0x4624, 0x57ad, 0x6536, 0x74bf, 0x8c48,

View File

@ -6,6 +6,8 @@ extern "C" {
#include <stdbool.h> #include <stdbool.h>
#include "user_math.h"
#define CRC16_INIT 0XFFFF #define CRC16_INIT 0XFFFF
uint16_t CRC16_Calc(const uint8_t *buf, size_t len, uint16_t crc); uint16_t CRC16_Calc(const uint8_t *buf, size_t len, uint16_t crc);

View File

@ -2,7 +2,7 @@
Linux Linux
*/ */
#include "crc8_rm.h" #include "crc8.h"
static const uint8_t crc8_tab[256] = { static const uint8_t crc8_tab[256] = {
0x00, 0x5e, 0xbc, 0xe2, 0x61, 0x3f, 0xdd, 0x83, 0xc2, 0x9c, 0x7e, 0x20, 0x00, 0x5e, 0xbc, 0xe2, 0x61, 0x3f, 0xdd, 0x83, 0xc2, 0x9c, 0x7e, 0x20,

View File

@ -142,7 +142,6 @@ static const uint8_t oled_font[95][8] = {
{0x00,0x08,0x04,0x04,0x08,0x10,0x10,0x08,}, /* "~", 94 */ {0x00,0x08,0x04,0x04,0x08,0x10,0x10,0x08,}, /* "~", 94 */
}; };
/* Exported functions ------------------------------------------------------- */ /* Exported functions ------------------------------------------------------- */
void OLED_Init(void) { void OLED_Init(void) {

View File

@ -13,38 +13,38 @@ extern "C"
#include <stdbool.h> #include <stdbool.h>
#include <stdint.h> #include <stdint.h>
/* Exported constants ------------------------------------------------------- */ /* Exported constants ------------------------------------------------------- */
/* Exported macro ----------------------------------------------------------- */ /* Exported macro ----------------------------------------------------------- */
/* Exported types ----------------------------------------------------------- */ /* Exported types ----------------------------------------------------------- */
typedef struct typedef struct
{ {
uint8_t head; uint8_t head;
uint8_t data; uint8_t data;
uint8_t crc; uint8_t crc;
} UART_RxData_t; } UART_RxData_t;
typedef struct typedef struct
{ {
uint8_t head; uint8_t head;
uint8_t data; uint8_t data;
uint8_t crc; uint8_t crc;
} UART_TxData_t; } UART_TxData_t;
typedef struct typedef struct
{ {
UART_RxData_t rx_data; // Received data buffer UART_RxData_t rx_data; // Received data buffer
UART_TxData_t tx_data; // Transmit data buffer UART_TxData_t tx_data; // Transmit data buffer
} UART_t; } UART_t;
/* Exported functions prototypes -------------------------------------------- */ /* Exported functions prototypes -------------------------------------------- */
int UART_Init(UART_t *huart); int UART_Init(UART_t *huart);
int UART_StartReceive(UART_t *huart); int UART_StartReceive(UART_t *huart);
bool UART_IsReceiveComplete(void); bool UART_IsReceiveComplete(void);
int8_t UART_ParseData(UART_t *huart); int8_t UART_ParseData(UART_t *huart);
void UART_PackTx(UART_t *huart, UART_TxData_t *tx_data); void UART_PackTx(UART_t *huart, UART_TxData_t *tx_data);
int8_t UART_StartSend(UART_t *huart); int8_t UART_StartSend(UART_t *huart);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif