📄 shared.c
字号:
/***************************************************************************** * Core A * Shared.c *****************************************************************************//* The recommended method for sharing data and code for the per-core approach is as follows. Refer to local_shared_symbols.h in the Core B project for further details on sharing data and code. For Core A抯 project: Define the data items to be shared in a source module that contains only shared items. Declare the data items to be volatile. Set the file attribute 'sharing' to 'MustShare', for the shared-data module. In the source module, declare the shared-data items to be part of a section that is shared by both cores. The default LDF provides to shared data sections, l2_shared and l2_sram. */#include <ccblkfn.h>/* The following is example code demonstrating the recommended method for sharing data. Shared data items must be declared volatile, and the 'sharing' file attribute must be set to 'MustShare'. This code is simply an example; define your own shared data as needed. */#pragma file_attr("sharing=MustShare")#pragma section("l2_shared")volatile int shared_variable;/* Sharing code follows similar steps as sharing data. For Core A抯 project, simply map the functions to the shared area, in the application for core A. The following is example code demonstrating the recommended method for sharing code. */#pragma section("l2_sram")void shared_function( void ){ /* Add shared function code here. */}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -