Solved
Why to use the macro in this way to reach to value at specific adress?
Hi,
I am working on FreeRTOS, I came to a section where I need to enable CYCNT register of Arm-Cortex. In order to achieve that, I understand I must set DWT_CTRL registers enable bit that is at 0xE0001000 address. All I dont understand is why a define like below (line#1) is used to assign the value of the register to a macro (DWT_CTRL) and modified at line#34 as below?
Could you pls point me in the right direction ?
#define DWT_CTRL *((volatile uint32_t*)0xE0001000)
int main(void)
{
/* USER CODE BEGIN 1 */
TaskHandle_t task1_handle;
TaskHandle_t task2_handle;
BaseType_t status;
/* 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();
/* USER CODE BEGIN 2 */
//Enable the CYCCNT
DWT_CTRL |= (1<<0);

