使用CubeMX新建DMA工程——存储器到外设模式

目录

1、新建板级支持包

1、usart.c:

2、修改的地方:在usart.c中添加了这些

3、usart.h:

4、在usart.h中添加了这些:

5、dma.c:

6、dma.h:

2、修改main.c文件

1、在main.c文件中添加头文件

2、添加外部变量声明

3、添加简单延时函数

4、添加应用代码

5、完整代码:

3、程序流程


新建工程的基本操作步骤参考这里:STM32CubeMX学习笔记(7)——DMA接口使用_cubemx dma-CSDN博客


1、新建板级支持包

LED板级支持包直接移植野火的,DMA板级支持包直接使用自动生成的代码在里面稍作修改

1、usart.c:

/* USER CODE BEGIN Header */
/********************************************************************************* @file    usart.c* @brief   This file provides code for the configuration*          of the USART instances.******************************************************************************* @attention** Copyright (c) 2025 STMicroelectronics.* All rights reserved.** This software is licensed under terms that can be found in the LICENSE file* in the root directory of this software component.* If no LICENSE file comes with this software, it is provided AS-IS.********************************************************************************/
/* USER CODE END Header */
/* Includes ------------------------------------------------------------------*/
#include "usart.h"/* USER CODE BEGIN 0 */
uint8_t SendBuff[SENDBUFF_SIZE];
/* USER CODE END 0 */UART_HandleTypeDef huart1;
DMA_HandleTypeDef hdma_usart1_tx;/* USART1 init function */void MX_USART1_UART_Init(void)
{/* USER CODE BEGIN USART1_Init 0 *//* USER CODE END USART1_Init 0 *//* USER CODE BEGIN USART1_Init 1 *//* USER CODE END USART1_Init 1 */huart1.Instance = USART1;huart1.Init.BaudRate = 115200;huart1.Init.WordLength = UART_WORDLENGTH_8B;huart1.Init.StopBits = UART_STOPBITS_1;huart1.Init.Parity = UART_PARITY_NONE;huart1.Init.Mode = UART_MODE_TX_RX;huart1.Init.HwFlowCtl = UART_HWCONTROL_NONE;huart1.Init.OverSampling = UART_OVERSAMPLING_16;if (HAL_UART_Init(&huart1) != HAL_OK){Error_Handler();}/* USER CODE BEGIN USART1_Init 2 *//* USER CODE END USART1_Init 2 */}///重定向c库函数printf到串口DEBUG_USART,重定向后可使用printf函数
int fputc(int ch, FILE *f)
{/* 发送一个字节数据到串口DEBUG_USART */HAL_UART_Transmit(&huart1, (uint8_t *)&ch, 1, 1000);	return (ch);
}///重定向c库函数scanf到串口DEBUG_USART,重写向后可使用scanf、getchar等函数
int fgetc(FILE *f)
{int ch;HAL_UART_Receive(&huart1, (uint8_t *)&ch, 1, 1000);	return (ch);
}void HAL_UART_MspInit(UART_HandleTypeDef* uartHandle)
{GPIO_InitTypeDef GPIO_InitStruct = {0};if(uartHandle->Instance==USART1){/* USER CODE BEGIN USART1_MspInit 0 *//* USER CODE END USART1_MspInit 0 *//* USART1 clock enable */__HAL_RCC_USART1_CLK_ENABLE();__HAL_RCC_GPIOA_CLK_ENABLE();/**USART1 GPIO ConfigurationPA9     ------> USART1_TXPA10     ------> USART1_RX*/GPIO_InitStruct.Pin = GPIO_PIN_9;GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH;HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);GPIO_InitStruct.Pin = GPIO_PIN_10;GPIO_InitStruct.Mode = GPIO_MODE_AF_INPUT;GPIO_InitStruct.Pull = GPIO_NOPULL;HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);/* USART1 DMA Init *//* USART1_TX Init */hdma_usart1_tx.Instance = DMA1_Channel4;hdma_usart1_tx.Init.Direction = DMA_MEMORY_TO_PERIPH;hdma_usart1_tx.Init.PeriphInc = DMA_PINC_DISABLE;hdma_usart1_tx.Init.MemInc = DMA_MINC_ENABLE;hdma_usart1_tx.Init.PeriphDataAlignment = DMA_PDATAALIGN_HALFWORD;hdma_usart1_tx.Init.MemDataAlignment = DMA_MDATAALIGN_HALFWORD;hdma_usart1_tx.Init.Mode = DMA_NORMAL;hdma_usart1_tx.Init.Priority = DMA_PRIORITY_MEDIUM;if (HAL_DMA_Init(&hdma_usart1_tx) != HAL_OK){Error_Handler();}__HAL_LINKDMA(uartHandle,hdmatx,hdma_usart1_tx);/* USER CODE BEGIN USART1_MspInit 1 *//* USER CODE END USART1_MspInit 1 */}
}void HAL_UART_MspDeInit(UART_HandleTypeDef* uartHandle)
{if(uartHandle->Instance==USART1){/* USER CODE BEGIN USART1_MspDeInit 0 *//* USER CODE END USART1_MspDeInit 0 *//* Peripheral clock disable */__HAL_RCC_USART1_CLK_DISABLE();/**USART1 GPIO ConfigurationPA9     ------> USART1_TXPA10     ------> USART1_RX*/HAL_GPIO_DeInit(GPIOA, GPIO_PIN_9|GPIO_PIN_10);/* USART1 DMA DeInit */HAL_DMA_DeInit(uartHandle->hdmatx);/* USER CODE BEGIN USART1_MspDeInit 1 *//* USER CODE END USART1_MspDeInit 1 */}
}/* USER CODE BEGIN 1 *//* USER CODE END 1 */

2、修改的地方:在usart.c中添加了这些

uint8_t SendBuff[SENDBUFF_SIZE];///重定向c库函数printf到串口DEBUG_USART,重定向后可使用printf函数
int fputc(int ch, FILE *f)
{/* 发送一个字节数据到串口DEBUG_USART */HAL_UART_Transmit(&huart1, (uint8_t *)&ch, 1, 1000);	return (ch);
}///重定向c库函数scanf到串口DEBUG_USART,重写向后可使用scanf、getchar等函数
int fgetc(FILE *f)
{int ch;HAL_UART_Receive(&huart1, (uint8_t *)&ch, 1, 1000);	return (ch);
}

3、usart.h:

/* USER CODE BEGIN Header */
/********************************************************************************* @file    usart.h* @brief   This file contains all the function prototypes for*          the usart.c file******************************************************************************* @attention** Copyright (c) 2025 STMicroelectronics.* All rights reserved.** This software is licensed under terms that can be found in the LICENSE file* in the root directory of this software component.* If no LICENSE file comes with this software, it is provided AS-IS.********************************************************************************/
/* USER CODE END Header */
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __USART_H__
#define __USART_H__#ifdef __cplusplus
extern "C" {
#endif/* Includes ------------------------------------------------------------------*/
#include "main.h"/* USER CODE BEGIN Includes */
#include <stdio.h>
/* USER CODE END Includes */extern UART_HandleTypeDef huart1;/* USER CODE BEGIN Private defines */
#define SENDBUFF_SIZE                     		1000//发送的数据量/* USER CODE END Private defines */void MX_USART1_UART_Init(void);/* USER CODE BEGIN Prototypes *//* USER CODE END Prototypes */#ifdef __cplusplus
}
#endif#endif /* __USART_H__ */

4、在usart.h中添加了这些:

#include <stdio.h>extern UART_HandleTypeDef huart1;#define SENDBUFF_SIZE                     		1000//发送的数据量

5、dma.c:

/* USER CODE BEGIN Header */
/********************************************************************************* @file    dma.c* @brief   This file provides code for the configuration*          of all the requested memory to memory DMA transfers.******************************************************************************* @attention** Copyright (c) 2025 STMicroelectronics.* All rights reserved.** This software is licensed under terms that can be found in the LICENSE file* in the root directory of this software component.* If no LICENSE file comes with this software, it is provided AS-IS.********************************************************************************/
/* USER CODE END Header *//* Includes ------------------------------------------------------------------*/
#include "dma.h"/* USER CODE BEGIN 0 *//* USER CODE END 0 *//*----------------------------------------------------------------------------*/
/* Configure DMA                                                              */
/*----------------------------------------------------------------------------*//* USER CODE BEGIN 1 *//* USER CODE END 1 *//*** Enable DMA controller clock*/
void MX_DMA_Init(void)
{/* DMA controller clock enable */__HAL_RCC_DMA1_CLK_ENABLE();/* DMA interrupt init *//* DMA1_Channel4_IRQn interrupt configuration */HAL_NVIC_SetPriority(DMA1_Channel4_IRQn, 0, 0);HAL_NVIC_EnableIRQ(DMA1_Channel4_IRQn);}/* USER CODE BEGIN 2 *//* USER CODE END 2 */

6、dma.h:

/* USER CODE BEGIN Header */
/********************************************************************************* @file    dma.h* @brief   This file contains all the function prototypes for*          the dma.c file******************************************************************************* @attention** Copyright (c) 2025 STMicroelectronics.* All rights reserved.** This software is licensed under terms that can be found in the LICENSE file* in the root directory of this software component.* If no LICENSE file comes with this software, it is provided AS-IS.********************************************************************************/
/* USER CODE END Header */
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __DMA_H__
#define __DMA_H__#ifdef __cplusplus
extern "C" {
#endif/* Includes ------------------------------------------------------------------*/
#include "main.h"/* DMA memory to memory transfer handles -------------------------------------*//* USER CODE BEGIN Includes *//* USER CODE END Includes *//* USER CODE BEGIN Private defines *//* USER CODE END Private defines */void MX_DMA_Init(void);/* USER CODE BEGIN Prototypes *//* USER CODE END Prototypes */#ifdef __cplusplus
}
#endif#endif /* __DMA_H__ */

2、修改main.c文件

1、在main.c文件中添加头文件

#include "stm32f1xx.h"
#include "./led/bsp_led.h"

2、添加外部变量声明

extern UART_HandleTypeDef huart1;
extern DMA_HandleTypeDef hdma_usart1_tx;
extern uint8_t SendBuff[SENDBUFF_SIZE];

3、添加简单延时函数

static void Delay(__IO uint32_t nCount)	 //简单的延时函数
{for(; nCount != 0; nCount--);
}

4、添加应用代码

int main(void)
{/* USER CODE BEGIN 1 */uint16_t i;/* USER CODE END 1 *//* MCU Configuration--------------------------------------------------------*//* Reset of all peripherals, Initializes the Flash interface and the Systick. */HAL_Init();/* USER CODE BEGIN Init *//* USER CODE END Init *//* Configure the system clock */SystemClock_Config();/* USER CODE BEGIN SysInit *//* USER CODE END SysInit *//* Initialize all configured peripherals */MX_GPIO_Init();MX_DMA_Init();MX_USART1_UART_Init();/* USER CODE BEGIN 2 *//* 配置RGB彩色灯 */LED_GPIO_Config();printf("\r\n USART1 DMA TX 测试 \r\n");/*填充将要发送的数据*/for(i=0;i<SENDBUFF_SIZE;i++){SendBuff[i]	 = 'A';}/* USART1 向 DMA发出TX请求 */HAL_UART_Transmit_DMA(&huart1, (uint8_t *)SendBuff ,SENDBUFF_SIZE);/* USER CODE END 2 *//* Infinite loop *//* USER CODE BEGIN WHILE */while (1){/* USER CODE END WHILE *//* 此时CPU是空闲的,可以干其他的事情 */  //例如同时控制LEDLED1_TOGGLEDelay(0xFFFFF);/* USER CODE BEGIN 3 */}/* USER CODE END 3 */
}

5、完整代码:

/* USER CODE BEGIN Header */
/********************************************************************************* @file           : main.c* @brief          : Main program body******************************************************************************* @attention** Copyright (c) 2025 STMicroelectronics.* All rights reserved.** This software is licensed under terms that can be found in the LICENSE file* in the root directory of this software component.* If no LICENSE file comes with this software, it is provided AS-IS.********************************************************************************/
/* USER CODE END Header */
/* Includes ------------------------------------------------------------------*/
#include "main.h"
#include "dma.h"
#include "usart.h"
#include "gpio.h"/* Private includes ----------------------------------------------------------*/
/* USER CODE BEGIN Includes */
#include "stm32f1xx.h"
#include "./led/bsp_led.h"
/* USER CODE END Includes *//* Private typedef -----------------------------------------------------------*/
/* USER CODE BEGIN PTD */
extern UART_HandleTypeDef huart1;
extern DMA_HandleTypeDef hdma_usart1_tx;
extern uint8_t SendBuff[SENDBUFF_SIZE];
static void Delay(__IO uint32_t nCount); /* USER CODE END PTD *//* Private define ------------------------------------------------------------*/
/* USER CODE BEGIN PD */
/* USER CODE END PD *//* Private macro -------------------------------------------------------------*/
/* USER CODE BEGIN PM *//* USER CODE END PM *//* Private variables ---------------------------------------------------------*//* USER CODE BEGIN PV *//* USER CODE END PV *//* Private function prototypes -----------------------------------------------*/
void SystemClock_Config(void);
/* USER CODE BEGIN PFP *//* USER CODE END PFP *//* Private user code ---------------------------------------------------------*/
/* USER CODE BEGIN 0 *//* USER CODE END 0 *//*** @brief  The application entry point.* @retval int*/
int main(void)
{/* USER CODE BEGIN 1 */uint16_t i;/* USER CODE END 1 *//* MCU Configuration--------------------------------------------------------*//* Reset of all peripherals, Initializes the Flash interface and the Systick. */HAL_Init();/* USER CODE BEGIN Init *//* USER CODE END Init *//* Configure the system clock */SystemClock_Config();/* USER CODE BEGIN SysInit *//* USER CODE END SysInit *//* Initialize all configured peripherals */MX_GPIO_Init();MX_DMA_Init();MX_USART1_UART_Init();/* USER CODE BEGIN 2 *//* 配置RGB彩色灯 */LED_GPIO_Config();printf("\r\n USART1 DMA TX 测试 \r\n");/*填充将要发送的数据*/for(i=0;i<SENDBUFF_SIZE;i++){SendBuff[i]	 = 'A';}/* USART1 向 DMA发出TX请求 */HAL_UART_Transmit_DMA(&huart1, (uint8_t *)SendBuff ,SENDBUFF_SIZE);/* USER CODE END 2 *//* Infinite loop *//* USER CODE BEGIN WHILE */while (1){/* USER CODE END WHILE *//* 此时CPU是空闲的,可以干其他的事情 */  //例如同时控制LEDLED1_TOGGLEDelay(0xFFFFF);/* USER CODE BEGIN 3 */}/* USER CODE END 3 */
}static void Delay(__IO uint32_t nCount)	 //简单的延时函数
{for(; nCount != 0; nCount--);
}/*** @brief System Clock Configuration* @retval None*/
void SystemClock_Config(void)
{RCC_OscInitTypeDef RCC_OscInitStruct = {0};RCC_ClkInitTypeDef RCC_ClkInitStruct = {0};/** Initializes the RCC Oscillators according to the specified parameters* in the RCC_OscInitTypeDef structure.*/RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE;RCC_OscInitStruct.HSEState = RCC_HSE_ON;RCC_OscInitStruct.HSEPredivValue = RCC_HSE_PREDIV_DIV1;RCC_OscInitStruct.HSIState = RCC_HSI_ON;RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE;RCC_OscInitStruct.PLL.PLLMUL = RCC_PLL_MUL9;if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK){Error_Handler();}/** Initializes the CPU, AHB and APB buses clocks*/RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK|RCC_CLOCKTYPE_SYSCLK|RCC_CLOCKTYPE_PCLK1|RCC_CLOCKTYPE_PCLK2;RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK;RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1;RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV2;RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV1;if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_2) != HAL_OK){Error_Handler();}
}/* USER CODE BEGIN 4 *//* USER CODE END 4 *//*** @brief  This function is executed in case of error occurrence.* @retval None*/
void Error_Handler(void)
{/* USER CODE BEGIN Error_Handler_Debug *//* User can add his own implementation to report the HAL error return state */__disable_irq();while (1){}/* USER CODE END Error_Handler_Debug */
}#ifdef  USE_FULL_ASSERT
/*** @brief  Reports the name of the source file and the source line number*         where the assert_param error has occurred.* @param  file: pointer to the source file name* @param  line: assert_param error line source number* @retval None*/
void assert_failed(uint8_t *file, uint32_t line)
{/* USER CODE BEGIN 6 *//* User can add his own implementation to report the file name and line number,ex: printf("Wrong parameters value: file %s on line %d\r\n", file, line) *//* USER CODE END 6 */
}
#endif /* USE_FULL_ASSERT */

3、程序流程

1、HAL库函数初始化

2、系统时钟初始化

3、GPIO  DMA  USART  LED  初始化

4、打印提示信息

5、填充将要发送的数据

6、USART1向DMA发出TX请求,开始DMA数据传输

7、同时CPU控制LED翻转

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/pingmian/79039.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

el-transfer穿梭框数据量过大的解决方案

一&#xff1a;背景 我们这个穿梭框获取的是项目的全量数据&#xff0c;在左边大概有5000条&#xff0c;自己测试了一下5000条数据的效果&#xff0c;发现异常的卡顿&#xff0c;本来打算像el-select一样去解决的&#xff08;只显示一部分&#xff0c;在搜索的时候去全量搜索&a…

2025年- H17-Lc125-73.矩阵置零(矩阵)---java版

1.题目描述 2.思路 &#xff08;1&#xff09;计算矩阵的行数 &#xff08;2&#xff09;计算矩阵的列数 &#xff08;3&#xff09;设计一个行列的bool数组 &#xff08;4&#xff09;遍历矩阵&#xff08;二维数组&#xff09;&#xff0c;如果遇到元素0&#xff0c;则把…

Qt二维码demo

使用QZXing库生成的二维码demo 运行结果 实现代码 c文件 #include "mainwindow.h" #include "ui_mainwindow.h" #include "src/myqrcodeheader.h"MainWindow::MainWindow(QWidget *parent) :QMainWindow(parent),ui(new Ui::MainWindow) {ui-&…

怪物猎人:世界-冰原10000+mod整合包5月最新更新!

700A大全套精美服装 800M大全套精美服装 3月31日更新 新增 新武器 新特效MOD 当前共计5800MOD整合包 好看的发型mod 实用的功能mod 炫酷的武器mod 新服装新特效新武器实用模组美化&#xff0c;等。 1月14日更新 新增皮肤MOD 500 当前共计2000MOD 1月16日更新 新增超…

华纳云:centos如何实现JSP页面的动态加载

JSP(JavaServer Pages)作为Java生态中常用的服务器端网页技术&#xff0c;具有动态内容生成、可扩展性强、与Java无缝结合等优势。 而CentOS作为一款稳定、高效、安全的Linux服务器操作系统&#xff0c;非常适合部署JSP应用。 想要让JSP页面实现动态更新加载&#xff0c;避免…

gradle-tasks.register(‘classesJar‘, Jar)解析

在使用gradle作为构建工具的android或者java web项目中&#xff0c;我们经常能遇到以下格式 tasks.register(classesJar, Jar) {from "$buildDir/intermediates/javac/release/classes" // 假设使用 release 构建变体 }artifact sourcesJar使用伪代码解释 class Cu…

数据处理1

一、常用数据处理模块Numpy Numpy常用于高性能计算&#xff0c;在机器学习常常作为传递数据的容器。提供了两种基本对象&#xff1a;ndarray、ufunc。 ndarray具有矢量算术运算和复杂广播能力的快速且节省空间的多维数组。 ufunc提供了对数组快速运算的标准数学函数。 ndar…

电力市场的交易品种

双边交易&#xff08;Bilateral Trading&#xff09; 定义&#xff1a;是电力市场中最基本的交易方式之一&#xff0c;指具备市场交易资格的买方和卖方&#xff0c;通过自主协商、双边协商的形式&#xff0c;确定交易电量、交易价格、交割曲线等交易要素&#xff0c;并签订中长…

uniapp 实现时分秒 分别倒计时

效果 <view class"issue-price-countdown"> <CountDown :endTimestamp"1745996085000"></CountDown> </view> 引入组件 import CountDown from /components/CountDown.vue; <template> <view class&qu…

从CRUD到复杂业务:AI自动生成电商优惠券叠加逻辑(新手救星指南)

在 Java 编程的广阔天地中,据统计,高达 80% 的新手会在业务逻辑编写环节陷入困境。业务逻辑作为软件系统的核心灵魂,承载着从用户需求到代码实现的关键转化过程,为何却成为新手难以逾越的 “鸿沟”?飞算 JavaAI 的出现,又将如何打破这一僵局? 一、Java 新手卡在业务逻辑的根…

23页PDF | 数据治理实施方案 :规划、执行、评价、改进四步走的管控模式

在当今数字化时代&#xff0c;数据已经成为企业和组织的核心资产之一。然而&#xff0c;随着数据量的不断增长和数据来源的日益多样化&#xff0c;数据治理变得愈发重要。有效的数据治理能够确保数据的质量、安全和合规性&#xff0c;提升数据的价值和利用效率。那么&#xff0…

curl详解

curl 是一个常用的命令行工具&#xff0c;用于发送 HTTP 请求&#xff0c;支持包括 GET、POST、PUT、DELETE 等在内的多种 HTTP 方法。它非常适合用来测试 API、下载文件、与后端服务进行交互等。接下来&#xff0c;我会详细讲解 curl 的基本用法以及常见的应用场景。 &#x…

Win11安装Ubuntu20.04简记

写在前面 之前装的22.04&#xff0c;不稳定&#xff0c;把22.04卸载了&#xff0c;重新安装20.04系统。这里主要把卸载和安装的过程中参考到的博客在这记录一下。 卸载ubuntu系统参考的博文 卸载参考博文1 卸载参考博文2 Ubuntu20.04安装参考博文 安装参考博文1 安装参考博…

云原生 | K8S中数据存储之StorageClass

在一个大规模的Kubernetes集群里,可能有成千上万个PVC,这就意味着运维人员必须实现创建出这个多个 PV,此外,随着项目的需要,会有新的PVC不断被提交,那么运维人员就需要不断的添加新的,满足要求的PV,否 则新的Pod就会因为PVC绑定不到PV而导致创建失败。而且通过 PVC 请求到一定的…

基于Hadoop大数据技术音乐推荐系统数据分析与可视化(基于Spark和Hive的音乐推荐系统数据分析与可视化)基于Python的音乐推荐系统数据分析与可视化

基于Hadoop大数据技术音乐推荐系统数据分析与可视化&#xff08;基于Spark和Hive的音乐推荐系统数据分析与可视化&#xff09;基于Python的音乐推荐系统数据分析与可视化 1. 开发工具和实现技术 Pycharm, Python3.7&#xff0c;Django框架&#xff0c;Hadoop&#xff0c;Spar…

podman/docker国内可用的docker镜像源(2025-05)

一、添加Docker国内镜像 1、修改 /etc/docker/daemon.json 设置 registry mirror&#xff0c;具体命令如下: sudo vim /etc/docker/daemon.json <<EOF {"registry-mirrors": ["https://docker.1ms.run","https://docker.xuanyuan.me",&q…

【Java ee初阶】多线程(4)

一、java是怎么做到可重入的 java中&#xff0c;通过synchronized进行加锁&#xff0c;指定一个&#xff08;&#xff09;包含了一个锁对象。&#xff08;锁对象本身是一个啥样的对象&#xff0c;这并不重要&#xff0c;重点关注锁对象是不是同一个对象&#xff09; 后面搭配…

LaTex、pdfLaTex、XeLaTex和luaLaTex的区别和联系

之前一直搞不懂这些乱七八糟的Tex到底有啥区别&#xff0c;不同引擎不同编译器换来换去&#xff0c;查了些资料又问了下AI&#xff0c;总算是搞懂了。 大概是这样&#xff0c;很久以前有人写了个Tex排版引擎&#xff0c;输入一些代码命令&#xff0c;输出dvi文件&#xff08;设…

【Unity】一个UI框架例子

使用框架前置条件&#xff1a;调整脚本运行顺序, Canvas挂载UIManager, Panel挂载对应的UIController、UI控件挂载UIControl。 UIManager:UI管理器&#xff0c;用于处理和管理各个UIController和UIControl的业务逻辑&#xff0c;挂载在Canvas上&#xff1b; UIController:界面层…

kalibr:相机模型

文章目录 📚简介Kalibr标定支持的相机模型及适用场景📌 针孔相机模型(Pinhole)🌐 全向相机模型(Omnidirectional)🔍 特殊模型💡 选型建议⚠️ 注意事项📚简介 Kalibr作为多传感器标定的重要工具,支持多种相机模型以适应不同光学特性的视觉传感器。其核心相机…