2023-05-3
This commit is contained in:
1 parent
633d9b872b
commit
063c3fcc07
74 files changed
+26281
-13954
No files matched your search
@@ -29,7 +29,7 @@
|
||||
#include <easyflash.h>
|
||||
#include <stdarg.h>
|
||||
#include <sfud.h>
|
||||
#include "FreeRTOS.h"
|
||||
#include <rtthread.h>
|
||||
|
||||
|
||||
|
||||
@@ -197,7 +197,8 @@ EfErrCode ef_port_write(uint32_t addr, const uint32_t *buf, size_t size) {
|
||||
* lock the ENV ram cache
|
||||
*/
|
||||
void ef_port_env_lock(void) {
|
||||
portENTER_CRITICAL();
|
||||
rt_enter_critical();
|
||||
// portENTER_CRITICAL();
|
||||
/* You can add your code under here. */
|
||||
//__disable_irq();
|
||||
|
||||
@@ -207,7 +208,8 @@ void ef_port_env_lock(void) {
|
||||
* unlock the ENV ram cache
|
||||
*/
|
||||
void ef_port_env_unlock(void) {
|
||||
portEXIT_CRITICAL();
|
||||
rt_exit_critical();
|
||||
// portEXIT_CRITICAL();
|
||||
/* You can add your code under here. */
|
||||
// __enable_irq();
|
||||
}
|
||||
|
||||
@@ -3,13 +3,6 @@
|
||||
#include<stdint.h>
|
||||
#include "crc.h"
|
||||
|
||||
|
||||
//static uint8_t s_tx_buffer[512];
|
||||
//static uint16_t s_tx_length;
|
||||
//static uint8_t rx_buffer[512];
|
||||
|
||||
|
||||
|
||||
// 读取保持寄存器的值
|
||||
// addr 寄存器地址
|
||||
// id 丛机地址
|
||||
@@ -29,5 +22,11 @@ int modbus_m_read_regist(uint8_t id,uint16_t addr,uint16_t length,uint8_t * data
|
||||
return index;
|
||||
}
|
||||
|
||||
//// 解析通过03 命令读取回来额寄存器数据
|
||||
//int modbus_m_read_regist_ack(uint)
|
||||
//{
|
||||
//
|
||||
//}
|
||||
|
||||
|
||||
|
||||
@@ -5,4 +5,7 @@
|
||||
|
||||
int modbus_m_read_regist(uint8_t id,uint16_t addr,uint16_t length,uint8_t * data);
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
@@ -31,7 +31,8 @@
|
||||
#include <stdio.h>
|
||||
#include "main.h"
|
||||
#include <string.h>
|
||||
#include "FreeRTOS.h"
|
||||
#include <rtthread.h>
|
||||
//#include "FreeRTOS.h"
|
||||
|
||||
void sfud_log_info (const char *format, ...);
|
||||
sfud_err qspi_send_then_recv (const void *send_buf, size_t send_length, void *recv_buf, size_t recv_length);
|
||||
@@ -50,14 +51,12 @@ void sfud_log_debug (const char *file, const long line, const char *format, ...)
|
||||
|
||||
static void spi_lock (const sfud_spi *spi)
|
||||
{
|
||||
portENTER_CRITICAL();
|
||||
//__disable_irq();
|
||||
rt_enter_critical();
|
||||
}
|
||||
|
||||
static void spi_unlock (const sfud_spi *spi)
|
||||
{
|
||||
portEXIT_CRITICAL();
|
||||
//__enable_irq();
|
||||
rt_exit_critical();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in new issue
Block a user