小白使用keil编程debug进入了harddefault,搞了半天没解决。求大佬帮下忙。

/* USER CODE BEGIN Header /
/
*


  • @file : main.c
  • @brief : Main program body ******************************************************************************
  • @attention *
  • © Copyright (c) 2019 STMicroelectronics.

  • All rights reserved. *
  • This software component is licensed by ST under BSD 3-Clause license,
  • the "License"; You may not use this file except in compliance with the
  • License. You may obtain a copy of the License at:
  • opensource.org/licenses/BSD-3-Clause * ****************************************************************************** / / USER CODE END Header */

/* Includes ------------------------------------------------------------------*/
#include "main.h"
#include "can.h"
#include "usart.h"
#include "gpio.h"

/* Private includes ----------------------------------------------------------*/
/* USER CODE BEGIN Includes /
void CAN_SetTxMsg(void)
{

hcan.pTxMsg->ExtId=0x1314; //使用的扩展ID
hcan.pTxMsg->IDE=CAN_ID_EXT; //扩展模式
hcan.pTxMsg->RTR=CAN_RTR_DATA; //发送的是数据
hcan.pTxMsg->DLC=8; //数据长度为2字节
hcan.pTxMsg->data[0]=0x01;
hcan.pTxMsg->data[1]=0x02;
hcan.pTxMsg->data[2]=0x03;
hcan.pTxMsg->data[3]=0x04;
hcan.pTxMsg->data[4]=0x05;
hcan.pTxMsg->data[5]=0x06;
hcan.pTxMsg->data[6]=0x07;
hcan.pTxMsg->data[7]=0x08;
}
/
USER CODE END Includes */

/* Private typedef -----------------------------------------------------------*/
/* USER CODE BEGIN PTD */

/* 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 */

    /* 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_CAN_Init();
    MX_USART1_UART_Init();
    /
    USER CODE BEGIN 2 */

    CAN_SetTxMsg();
    HAL_CAN_AddTxMessage(&hcan,hcan.pTxMsg,hcan.pTxMsg->data,(uint32_t*)CAN_TX_MAILBOX0);
    HAL_CAN_ActivateNotification(&hcan,CAN_IT_RX_FIFO0_MSG_PENDING);

    /* USER CODE END 2 */

    /* Infinite loop /
    /
    USER CODE BEGIN WHILE /
    while (1)
    {
    /
    USER CODE END WHILE */

    /* USER CODE BEGIN 3 /
    }
    /
    USER CODE END 3 */
    }

/**

  • @brief System Clock Configuration
  • @retval None
    */
    void SystemClock_Config(void)
    {
    RCC_OscInitTypeDef RCC_OscInitStruct = {0};
    RCC_ClkInitTypeDef RCC_ClkInitStruct = {0};

    /** Initializes the CPU, AHB and APB busses clocks
    /
    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 busses 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();
    }
    /** Enables the Clock Security System
    */
    HAL_RCC_EnableCSS();
    }

/* USER CODE BEGIN 4 */
void HAL_CAN_RxFifo0MsgPendingCallback(CAN_HandleTypeDef *hcan)
{

HAL_CAN_AddTxMessage(hcan,hcan->pTxMsg,hcan->pTxMsg->data,(uint32_t*)CAN_TX_MAILBOX0);

HAL_CAN_ActivateNotification(hcan,CAN_IT_RX_FIFO0_MSG_PENDING);

}
/* 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 */

    /* 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, tex: printf("Wrong parameters value: file %s on line %d\r\n", file, line) / / USER CODE END 6 / } #endif / USE_FULL_ASSERT */

/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/

这是我的主程序,debug总是在CAN_SetMsg()那里进入了hardfault.下面是定义的一些初始化结构体。

/**


  • @file stm32f1xx_hal_can.h
  • @author MCD Application Team
  • @brief Header file of CAN HAL module. ******************************************************************************
  • @attention *
  • © COPYRIGHT(c) 2016 STMicroelectronics

    *
  • Redistribution and use in source and binary forms, with or without modification,
  • are permitted provided that the following conditions are met:
  • 1. Redistributions of source code must retain the above copyright notice,
  • this list of conditions and the following disclaimer.
  • 2. Redistributions in binary form must reproduce the above copyright notice,
  • this list of conditions and the following disclaimer in the documentation
  • and/or other materials provided with the distribution.
  • 3. Neither the name of STMicroelectronics nor the names of its contributors
  • may be used to endorse or promote products derived from this software
  • without specific prior written permission. *
  • THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  • AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  • IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  • DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
  • FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  • DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
  • SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
  • CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  • OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  • OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * ****************************************************************************** */

/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef STM32F1xx_HAL_CAN_H
#define STM32F1xx_HAL_CAN_H

#ifdef __cplusplus
extern "C" {
#endif

/* Includes ------------------------------------------------------------------*/
#include "stm32f1xx_hal_def.h"

/** @addtogroup STM32F1xx_HAL_Driver

  • @{ */

#if defined (CAN1)
/** @addtogroup CAN

  • @{ */

/* Exported types ------------------------------------------------------------*/
/** @defgroup CAN_Exported_Types CAN Exported Types

  • @{ / /*
  • @brief HAL State structures definition / typedef enum { HAL_CAN_STATE_RESET = 0x00U, /!< CAN not yet initialized or disabled / HAL_CAN_STATE_READY = 0x01U, /!< CAN initialized and ready for use / HAL_CAN_STATE_LISTENING = 0x02U, /!< CAN receive process is ongoing / HAL_CAN_STATE_SLEEP_PENDING = 0x03U, /!< CAN sleep request is pending / HAL_CAN_STATE_SLEEP_ACTIVE = 0x04U, /!< CAN sleep mode is active / HAL_CAN_STATE_ERROR = 0x05U /!< CAN error state */

} HAL_CAN_StateTypeDef;

/**

  • @brief CAN init structure definition
    /
    typedef struct
    {
    uint32_t Prescaler; /
    !< Specifies the length of a time quantum.
    This parameter must be a number between Min_Data = 1 and Max_Data = 1024. */

    uint32_t Mode; /*!< Specifies the CAN operating mode.
    This parameter can be a value of @ref CAN_operating_mode */

    uint32_t SyncJumpWidth; /*!< Specifies the maximum number of time quanta the CAN hardware
    is allowed to lengthen or shorten a bit to perform resynchronization.
    This parameter can be a value of @ref CAN_synchronisation_jump_width */

    uint32_t TimeSeg1; /*!< Specifies the number of time quanta in Bit Segment 1.
    This parameter can be a value of @ref CAN_time_quantum_in_bit_segment_1 */

    uint32_t TimeSeg2; /*!< Specifies the number of time quanta in Bit Segment 2.
    This parameter can be a value of @ref CAN_time_quantum_in_bit_segment_2 */

    FunctionalState TimeTriggeredMode; /*!< Enable or disable the time triggered communication mode.
    This parameter can be set to ENABLE or DISABLE. */

    FunctionalState AutoBusOff; /*!< Enable or disable the automatic bus-off management.
    This parameter can be set to ENABLE or DISABLE. */

    FunctionalState AutoWakeUp; /*!< Enable or disable the automatic wake-up mode.
    This parameter can be set to ENABLE or DISABLE. */

    FunctionalState AutoRetransmission; /*!< Enable or disable the non-automatic retransmission mode.
    This parameter can be set to ENABLE or DISABLE. */

    FunctionalState ReceiveFifoLocked; /*!< Enable or disable the Receive FIFO Locked mode.
    This parameter can be set to ENABLE or DISABLE. */

    FunctionalState TransmitFifoPriority;/*!< Enable or disable the transmit FIFO priority.
    This parameter can be set to ENABLE or DISABLE. */

} CAN_InitTypeDef;

/**

  • @brief CAN filter configuration structure definition
    /
    typedef struct
    {
    uint32_t FilterIdHigh; /
    !< Specifies the filter identification number (MSBs for a 32-bit
    configuration, first one for a 16-bit configuration).
    This parameter must be a number between Min_Data = 0x0000 and Max_Data = 0xFFFF. */

    uint32_t FilterIdLow; /*!< Specifies the filter identification number (LSBs for a 32-bit
    configuration, second one for a 16-bit configuration).
    This parameter must be a number between Min_Data = 0x0000 and Max_Data = 0xFFFF. */

    uint32_t FilterMaskIdHigh; /*!< Specifies the filter mask number or identification number,
    according to the mode (MSBs for a 32-bit configuration,
    first one for a 16-bit configuration).
    This parameter must be a number between Min_Data = 0x0000 and Max_Data = 0xFFFF. */

    uint32_t FilterMaskIdLow; /*!< Specifies the filter mask number or identification number,
    according to the mode (LSBs for a 32-bit configuration,
    second one for a 16-bit configuration).
    This parameter must be a number between Min_Data = 0x0000 and Max_Data = 0xFFFF. */

    uint32_t FilterFIFOAssignment; /*!< Specifies the FIFO (0 or 1U) which will be assigned to the filter.
    This parameter can be a value of @ref CAN_filter_FIFO */

    uint32_t FilterBank; /*!< Specifies the filter bank which will be initialized.
    For single CAN instance(14 dedicated filter banks),
    this parameter must be a number between Min_Data = 0 and Max_Data = 13.
    For dual CAN instances(28 filter banks shared),
    this parameter must be a number between Min_Data = 0 and Max_Data = 27. */

    uint32_t FilterMode; /*!< Specifies the filter mode to be initialized.
    This parameter can be a value of @ref CAN_filter_mode */

    uint32_t FilterScale; /*!< Specifies the filter scale.
    This parameter can be a value of @ref CAN_filter_scale */

    uint32_t FilterActivation; /*!< Enable or disable the filter.
    This parameter can be a value of @ref CAN_filter_activation */

    uint32_t SlaveStartFilterBank; /*!< Select the start filter bank for the slave CAN instance.
    For single CAN instances, this parameter is meaningless.
    For dual CAN instances, all filter banks with lower index are assigned to master
    CAN instance, whereas all filter banks with greater index are assigned to slave
    CAN instance.
    This parameter must be a number between Min_Data = 0 and Max_Data = 27. */

} CAN_FilterTypeDef;

/**

  • @brief CAN Tx message header structure definition
    /
    typedef struct
    {
    uint32_t StdId; /
    !< Specifies the standard identifier.
    This parameter must be a number between Min_Data = 0 and Max_Data = 0x7FF. */

    uint32_t ExtId; /*!< Specifies the extended identifier.
    This parameter must be a number between Min_Data = 0 and Max_Data = 0x1FFFFFFF. */

    uint32_t IDE; /*!< Specifies the type of identifier for the message that will be transmitted.
    This parameter can be a value of @ref CAN_identifier_type */

    uint32_t RTR; /*!< Specifies the type of frame for the message that will be transmitted.
    This parameter can be a value of @ref CAN_remote_transmission_request */

    uint32_t DLC; /*!< Specifies the length of the frame that will be transmitted.
    This parameter must be a number between Min_Data = 0 and Max_Data = 8. */

    uint8_t data[8];

    FunctionalState TransmitGlobalTime; /*!< Specifies whether the timestamp counter value captured on start
    of frame transmission, is sent in DATA6 and DATA7 replacing pData[6] and pData[7].
    @note: Time Triggered Communication Mode must be enabled.
    @note: DLC must be programmed as 8 bytes, in order these 2 bytes are sent.
    This parameter can be set to ENABLE or DISABLE. */

} CAN_TxHeaderTypeDef;

/**

  • @brief CAN Rx message header structure definition
    /
    typedef struct
    {
    uint32_t StdId; /
    !< Specifies the standard identifier.
    This parameter must be a number between Min_Data = 0 and Max_Data = 0x7FF. */

    uint32_t ExtId; /*!< Specifies the extended identifier.
    This parameter must be a number between Min_Data = 0 and Max_Data = 0x1FFFFFFF. */

    uint32_t IDE; /*!< Specifies the type of identifier for the message that will be transmitted.
    This parameter can be a value of @ref CAN_identifier_type */

    uint32_t RTR; /*!< Specifies the type of frame for the message that will be transmitted.
    This parameter can be a value of @ref CAN_remote_transmission_request */

    uint32_t DLC; /*!< Specifies the length of the frame that will be transmitted.
    This parameter must be a number between Min_Data = 0 and Max_Data = 8. */

    uint8_t Data[8];

    uint32_t Timestamp; /*!< Specifies the timestamp counter value captured on start of frame reception.
    @note: Time Triggered Communication Mode must be enabled.
    This parameter must be a number between Min_Data = 0 and Max_Data = 0xFFFF. */

    uint32_t FilterMatchIndex; /*!< Specifies the index of matching acceptance filter element.
    This parameter must be a number between Min_Data = 0 and Max_Data = 0xFF. */

} CAN_RxHeaderTypeDef;

/**

  • @brief CAN handle Structure definition
    /
    typedef struct __CAN_HandleTypeDef
    {
    CAN_TypeDef *Instance; /
    !< Register base address */

    CAN_InitTypeDef Init; /*!< CAN required parameters */

    CAN_TxHeaderTypeDef* pTxMsg;

    CAN_RxHeaderTypeDef* pRxMsg;

    HAL_LockTypeDef Lock;

    __IO HAL_CAN_StateTypeDef State; /*!< CAN communication state */

    __IO uint32_t ErrorCode; /*!< CAN Error code.
    This parameter can be a value of @ref CAN_Error_Code */

} CAN_HandleTypeDef;

/**

  • @} */

/* Exported constants --------------------------------------------------------*/

/** @defgroup CAN_Exported_Constants CAN Exported Constants

  • @{ */

/** @defgroup CAN_Error_Code CAN Error Code

  • @{ / #define HAL_CAN_ERROR_NONE (0x00000000U) /!< No error / #define HAL_CAN_ERROR_EWG (0x00000001U) /!< Protocol Error Warning / #define HAL_CAN_ERROR_EPV (0x00000002U) /!< Error Passive / #define HAL_CAN_ERROR_BOF (0x00000004U) /!< Bus-off error / #define HAL_CAN_ERROR_STF (0x00000008U) /!< Stuff error / #define HAL_CAN_ERROR_FOR (0x00000010U) /!< Form error / #define HAL_CAN_ERROR_ACK (0x00000020U) /!< Acknowledgment error / #define HAL_CAN_ERROR_BR (0x00000040U) /!< Bit recessive error / #define HAL_CAN_ERROR_BD (0x00000080U) /!< Bit dominant error / #define HAL_CAN_ERROR_CRC (0x00000100U) /!< CRC error / #define HAL_CAN_ERROR_RX_FOV0 (0x00000200U) /!< Rx FIFO0 overrun error / #define HAL_CAN_ERROR_RX_FOV1 (0x00000400U) /!< Rx FIFO1 overrun error / #define HAL_CAN_ERROR_TX_ALST0 (0x00000800U) /!< TxMailbox 0 transmit failure due to arbitration lost / #define HAL_CAN_ERROR_TX_TERR0 (0x00001000U) /!< TxMailbox 1 transmit failure due to tranmit error / #define HAL_CAN_ERROR_TX_ALST1 (0x00002000U) /!< TxMailbox 0 transmit failure due to arbitration lost / #define HAL_CAN_ERROR_TX_TERR1 (0x00004000U) /!< TxMailbox 1 transmit failure due to tranmit error / #define HAL_CAN_ERROR_TX_ALST2 (0x00008000U) /!< TxMailbox 0 transmit failure due to arbitration lost / #define HAL_CAN_ERROR_TX_TERR2 (0x00010000U) /!< TxMailbox 1 transmit failure due to tranmit error / #define HAL_CAN_ERROR_TIMEOUT (0x00020000U) /!< Timeout error / #define HAL_CAN_ERROR_NOT_INITIALIZED (0x00040000U) /!< Peripheral not initialized / #define HAL_CAN_ERROR_NOT_READY (0x00080000U) /!< Peripheral not ready / #define HAL_CAN_ERROR_NOT_STARTED (0x00100000U) /!< Peripheral not started / #define HAL_CAN_ERROR_PARAM (0x00200000U) /!< Parameter error */

#define HAL_CAN_ERROR_INTERNAL (0x00800000U) /*!< Internal error */

/**

  • @} */

/** @defgroup CAN_InitStatus CAN InitStatus

  • @{ / #define CAN_INITSTATUS_FAILED (0x00000000U) /!< CAN initialization failed / #define CAN_INITSTATUS_SUCCESS (0x00000001U) /!< CAN initialization OK / /*
  • @} */

/** @defgroup CAN_operating_mode CAN Operating Mode

  • @{ / #define CAN_MODE_NORMAL (0x00000000U) /!< Normal mode / #define CAN_MODE_LOOPBACK ((uint32_t)CAN_BTR_LBKM) /!< Loopback mode / #define CAN_MODE_SILENT ((uint32_t)CAN_BTR_SILM) /!< Silent mode / #define CAN_MODE_SILENT_LOOPBACK ((uint32_t)(CAN_BTR_LBKM | CAN_BTR_SILM)) /!< Loopback combined with silent mode / /*
  • @} */

/** @defgroup CAN_synchronisation_jump_width CAN Synchronization Jump Width

  • @{ / #define CAN_SJW_1TQ (0x00000000U) /!< 1 time quantum / #define CAN_SJW_2TQ ((uint32_t)CAN_BTR_SJW_0) /!< 2 time quantum / #define CAN_SJW_3TQ ((uint32_t)CAN_BTR_SJW_1) /!< 3 time quantum / #define CAN_SJW_4TQ ((uint32_t)CAN_BTR_SJW) /!< 4 time quantum / /*
  • @} */

/** @defgroup CAN_time_quantum_in_bit_segment_1 CAN Time Quantum in Bit Segment 1

  • @{ / #define CAN_BS1_1TQ (0x00000000U) /!< 1 time quantum / #define CAN_BS1_2TQ ((uint32_t)CAN_BTR_TS1_0) /!< 2 time quantum / #define CAN_BS1_3TQ ((uint32_t)CAN_BTR_TS1_1) /!< 3 time quantum / #define CAN_BS1_4TQ ((uint32_t)(CAN_BTR_TS1_1 | CAN_BTR_TS1_0)) /!< 4 time quantum / #define CAN_BS1_5TQ ((uint32_t)CAN_BTR_TS1_2) /!< 5 time quantum / #define CAN_BS1_6TQ ((uint32_t)(CAN_BTR_TS1_2 | CAN_BTR_TS1_0)) /!< 6 time quantum / #define CAN_BS1_7TQ ((uint32_t)(CAN_BTR_TS1_2 | CAN_BTR_TS1_1)) /!< 7 time quantum / #define CAN_BS1_8TQ ((uint32_t)(CAN_BTR_TS1_2 | CAN_BTR_TS1_1 | CAN_BTR_TS1_0)) /!< 8 time quantum / #define CAN_BS1_9TQ ((uint32_t)CAN_BTR_TS1_3) /!< 9 time quantum / #define CAN_BS1_10TQ ((uint32_t)(CAN_BTR_TS1_3 | CAN_BTR_TS1_0)) /!< 10 time quantum / #define CAN_BS1_11TQ ((uint32_t)(CAN_BTR_TS1_3 | CAN_BTR_TS1_1)) /!< 11 time quantum / #define CAN_BS1_12TQ ((uint32_t)(CAN_BTR_TS1_3 | CAN_BTR_TS1_1 | CAN_BTR_TS1_0)) /!< 12 time quantum / #define CAN_BS1_13TQ ((uint32_t)(CAN_BTR_TS1_3 | CAN_BTR_TS1_2)) /!< 13 time quantum / #define CAN_BS1_14TQ ((uint32_t)(CAN_BTR_TS1_3 | CAN_BTR_TS1_2 | CAN_BTR_TS1_0)) /!< 14 time quantum / #define CAN_BS1_15TQ ((uint32_t)(CAN_BTR_TS1_3 | CAN_BTR_TS1_2 | CAN_BTR_TS1_1)) /!< 15 time quantum / #define CAN_BS1_16TQ ((uint32_t)CAN_BTR_TS1) /!< 16 time quantum / /*
  • @} */

/** @defgroup CAN_time_quantum_in_bit_segment_2 CAN Time Quantum in Bit Segment 2

  • @{ / #define CAN_BS2_1TQ (0x00000000U) /!< 1 time quantum / #define CAN_BS2_2TQ ((uint32_t)CAN_BTR_TS2_0) /!< 2 time quantum / #define CAN_BS2_3TQ ((uint32_t)CAN_BTR_TS2_1) /!< 3 time quantum / #define CAN_BS2_4TQ ((uint32_t)(CAN_BTR_TS2_1 | CAN_BTR_TS2_0)) /!< 4 time quantum / #define CAN_BS2_5TQ ((uint32_t)CAN_BTR_TS2_2) /!< 5 time quantum / #define CAN_BS2_6TQ ((uint32_t)(CAN_BTR_TS2_2 | CAN_BTR_TS2_0)) /!< 6 time quantum / #define CAN_BS2_7TQ ((uint32_t)(CAN_BTR_TS2_2 | CAN_BTR_TS2_1)) /!< 7 time quantum / #define CAN_BS2_8TQ ((uint32_t)CAN_BTR_TS2) /!< 8 time quantum / /*
  • @} */

/** @defgroup CAN_filter_mode CAN Filter Mode

  • @{ / #define CAN_FILTERMODE_IDMASK (0x00000000U) /!< Identifier mask mode / #define CAN_FILTERMODE_IDLIST (0x00000001U) /!< Identifier list mode / /*
  • @} */

/** @defgroup CAN_filter_scale CAN Filter Scale

  • @{ / #define CAN_FILTERSCALE_16BIT (0x00000000U) /!< Two 16-bit filters / #define CAN_FILTERSCALE_32BIT (0x00000001U) /!< One 32-bit filter / /*
  • @} */

/** @defgroup CAN_filter_activation CAN Filter Activation

  • @{ / #define CAN_FILTER_DISABLE (0x00000000U) /!< Disable filter / #define CAN_FILTER_ENABLE (0x00000001U) /!< Enable filter / /*
  • @} */

/** @defgroup CAN_filter_FIFO CAN Filter FIFO

  • @{ / #define CAN_FILTER_FIFO0 (0x00000000U) /!< Filter FIFO 0 assignment for filter x / #define CAN_FILTER_FIFO1 (0x00000001U) /!< Filter FIFO 1 assignment for filter x / /*
  • @} */

/** @defgroup CAN_identifier_type CAN Identifier Type

  • @{ / #define CAN_ID_STD ((uint32_t)0x00000000) /!< Standard Id / #define CAN_ID_EXT ((uint32_t)0x00000004) /!< Extended Id / /*
  • @} */

/** @defgroup CAN_remote_transmission_request CAN Remote Transmission Request

  • @{ / #define CAN_RTR_DATA ((uint32_t)0x00000000) /!< Data frame / #define CAN_RTR_REMOTE ((uint32_t)0x00000002) /!< Remote frame / /*
  • @} */

/** @defgroup CAN_receive_FIFO_number CAN Receive FIFO Number

  • @{ / #define CAN_RX_FIFO0 (0x00000000U) /!< CAN receive FIFO 0 / #define CAN_RX_FIFO1 (0x00000001U) /!< CAN receive FIFO 1 / /*
  • @} */

/** @defgroup CAN_Tx_Mailboxes CAN Tx Mailboxes

  • @{ / #define CAN_TX_MAILBOX0 (0x00000001U) /!< Tx Mailbox 0 / #define CAN_TX_MAILBOX1 (0x00000002U) /!< Tx Mailbox 1 / #define CAN_TX_MAILBOX2 (0x00000004U) /!< Tx Mailbox 2 / /*
  • @} */

/** @defgroup CAN_flags CAN Flags

  • @{ / / Transmit Flags / #define CAN_FLAG_RQCP0 (0x00000500U) /!< Request complete MailBox 0 flag / #define CAN_FLAG_TXOK0 (0x00000501U) /!< Transmission OK MailBox 0 flag / #define CAN_FLAG_ALST0 (0x00000502U) /!< Arbitration Lost MailBox 0 flag / #define CAN_FLAG_TERR0 (0x00000503U) /!< Transmission error MailBox 0 flag / #define CAN_FLAG_RQCP1 (0x00000508U) /!< Request complete MailBox1 flag / #define CAN_FLAG_TXOK1 (0x00000509U) /!< Transmission OK MailBox 1 flag / #define CAN_FLAG_ALST1 (0x0000050AU) /!< Arbitration Lost MailBox 1 flag / #define CAN_FLAG_TERR1 (0x0000050BU) /!< Transmission error MailBox 1 flag / #define CAN_FLAG_RQCP2 (0x00000510U) /!< Request complete MailBox2 flag / #define CAN_FLAG_TXOK2 (0x00000511U) /!< Transmission OK MailBox 2 flag / #define CAN_FLAG_ALST2 (0x00000512U) /!< Arbitration Lost MailBox 2 flag / #define CAN_FLAG_TERR2 (0x00000513U) /!< Transmission error MailBox 2 flag / #define CAN_FLAG_TME0 (0x0000051AU) /!< Transmit mailbox 0 empty flag / #define CAN_FLAG_TME1 (0x0000051BU) /!< Transmit mailbox 1 empty flag / #define CAN_FLAG_TME2 (0x0000051CU) /!< Transmit mailbox 2 empty flag / #define CAN_FLAG_LOW0 (0x0000051DU) /!< Lowest priority mailbox 0 flag / #define CAN_FLAG_LOW1 (0x0000051EU) /!< Lowest priority mailbox 1 flag / #define CAN_FLAG_LOW2 (0x0000051FU) /!< Lowest priority mailbox 2 flag */

/* Receive Flags /
#define CAN_FLAG_FF0 (0x00000203U) /
!< RX FIFO 0 Full flag /
#define CAN_FLAG_FOV0 (0x00000204U) /
!< RX FIFO 0 Overrun flag /
#define CAN_FLAG_FF1 (0x00000403U) /
!< RX FIFO 1 Full flag /
#define CAN_FLAG_FOV1 (0x00000404U) /
!< RX FIFO 1 Overrun flag */

/* Operating Mode Flags /
#define CAN_FLAG_INAK (0x00000100U) /
!< Initialization acknowledge flag /
#define CAN_FLAG_SLAK (0x00000101U) /
!< Sleep acknowledge flag /
#define CAN_FLAG_ERRI (0x00000102U) /
!< Error flag /
#define CAN_FLAG_WKU (0x00000103U) /
!< Wake up interrupt flag /
#define CAN_FLAG_SLAKI (0x00000104U) /
!< Sleep acknowledge interrupt flag */

/* Error Flags /
#define CAN_FLAG_EWG (0x00000300U) /
!< Error warning flag /
#define CAN_FLAG_EPV (0x00000301U) /
!< Error passive flag /
#define CAN_FLAG_BOF (0x00000302U) /
!< Bus-Off flag /
/
*

  • @} */

/** @defgroup CAN_Interrupts CAN Interrupts

  • @{ / / Transmit Interrupt / #define CAN_IT_TX_MAILBOX_EMPTY ((uint32_t)CAN_IER_TMEIE) /!< Transmit mailbox empty interrupt */

/* Receive Interrupts /
#define CAN_IT_RX_FIFO0_MSG_PENDING ((uint32_t)CAN_IER_FMPIE0) /
!< FIFO 0 message pending interrupt /
#define CAN_IT_RX_FIFO0_FULL ((uint32_t)CAN_IER_FFIE0) /
!< FIFO 0 full interrupt /
#define CAN_IT_RX_FIFO0_OVERRUN ((uint32_t)CAN_IER_FOVIE0) /
!< FIFO 0 overrun interrupt /
#define CAN_IT_RX_FIFO1_MSG_PENDING ((uint32_t)CAN_IER_FMPIE1) /
!< FIFO 1 message pending interrupt /
#define CAN_IT_RX_FIFO1_FULL ((uint32_t)CAN_IER_FFIE1) /
!< FIFO 1 full interrupt /
#define CAN_IT_RX_FIFO1_OVERRUN ((uint32_t)CAN_IER_FOVIE1) /
!< FIFO 1 overrun interrupt */

/* Operating Mode Interrupts /
#define CAN_IT_WAKEUP ((uint32_t)CAN_IER_WKUIE) /
!< Wake-up interrupt /
#define CAN_IT_SLEEP_ACK ((uint32_t)CAN_IER_SLKIE) /
!< Sleep acknowledge interrupt */

/* Error Interrupts /
#define CAN_IT_ERROR_WARNING ((uint32_t)CAN_IER_EWGIE) /
!< Error warning interrupt /
#define CAN_IT_ERROR_PASSIVE ((uint32_t)CAN_IER_EPVIE) /
!< Error passive interrupt /
#define CAN_IT_BUSOFF ((uint32_t)CAN_IER_BOFIE) /
!< Bus-off interrupt /
#define CAN_IT_LAST_ERROR_CODE ((uint32_t)CAN_IER_LECIE) /
!< Last error code interrupt /
#define CAN_IT_ERROR ((uint32_t)CAN_IER_ERRIE) /
!< Error Interrupt /
/
*

  • @} */

/**

  • @} */

/* Exported macros -----------------------------------------------------------*/
/** @defgroup CAN_Exported_Macros CAN Exported Macros

  • @{ */

/** @brief Reset CAN handle state

  • @param HANDLE CAN handle.
  • @retval None */ #define HAL_CAN_RESET_HANDLE_STATE(HANDLE__) ((__HANDLE__)->State = HAL_CAN_STATE_RESET)

/**

  • @brief Enable the specified CAN interrupts.
  • @param HANDLE CAN handle.
  • @param INTERRUPT CAN Interrupt sources to enable.
  • This parameter can be any combination of @arg CAN_Interrupts
  • @retval None */ #define HAL_CAN_ENABLE_IT(HANDLE__, INTERRUPT) (((__HANDLE__)->Instance->IER) |= (__INTERRUPT__))

/**

  • @brief Disable the specified CAN interrupts.
  • @param HANDLE CAN handle.
  • @param INTERRUPT CAN Interrupt sources to disable.
  • This parameter can be any combination of @arg CAN_Interrupts
  • @retval None */ #define HAL_CAN_DISABLE_IT(HANDLE__, INTERRUPT) (((__HANDLE__)->Instance->IER) &= ~(__INTERRUPT__))

/** @brief Check if the specified CAN interrupt source is enabled or disabled.

  • @param HANDLE specifies the CAN Handle.
  • @param INTERRUPT specifies the CAN interrupt source to check.
  • This parameter can be a value of @arg CAN_Interrupts
  • @retval The state of IT (TRUE or FALSE). */ #define HAL_CAN_GET_IT_SOURCE(HANDLE__, INTERRUPT) (((__HANDLE__)->Instance->IER) & (__INTERRUPT__))

/** @brief Check whether the specified CAN flag is set or not.

  • @param HANDLE specifies the CAN Handle.
  • @param FLAG specifies the flag to check.
  • This parameter can be one of @arg CAN_flags
  • @retval The state of FLAG (TRUE or FALSE). */ #define HAL_CAN_GET_FLAG(HANDLE__, FLAG) \ ((((__FLAG__) >> 8U) == 5U)? ((((__HANDLE__)->Instance->TSR) & (1U << ((__FLAG__) & CAN_FLAG_MASK))) == (1U << ((__FLAG__) & CAN_FLAG_MASK))): \ (((__FLAG__) >> 8U) == 2U)? ((((__HANDLE__)->Instance->RF0R) & (1U << ((__FLAG__) & CAN_FLAG_MASK))) == (1U << ((__FLAG__) & CAN_FLAG_MASK))): \ (((__FLAG__) >> 8U) == 4U)? ((((__HANDLE__)->Instance->RF1R) & (1U << ((__FLAG__) & CAN_FLAG_MASK))) == (1U << ((__FLAG__) & CAN_FLAG_MASK))): \ (((__FLAG__) >> 8U) == 1U)? ((((__HANDLE__)->Instance->MSR) & (1U << ((__FLAG__) & CAN_FLAG_MASK))) == (1U << ((__FLAG__) & CAN_FLAG_MASK))): \ (((__FLAG__) >> 8U) == 3U)? ((((__HANDLE__)->Instance->ESR) & (1U << ((__FLAG__) & CAN_FLAG_MASK))) == (1U << ((__FLAG__) & CAN_FLAG_MASK))): 0U)

/** @brief Clear the specified CAN pending flag.

  • @param HANDLE specifies the CAN Handle.
  • @param FLAG specifies the flag to check.
  • This parameter can be one of the following values:
  • @arg CAN_FLAG_RQCP0: Request complete MailBox 0 Flag
  • @arg CAN_FLAG_TXOK0: Transmission OK MailBox 0 Flag
  • @arg CAN_FLAG_ALST0: Arbitration Lost MailBox 0 Flag
  • @arg CAN_FLAG_TERR0: Transmission error MailBox 0 Flag
  • @arg CAN_FLAG_RQCP1: Request complete MailBox 1 Flag
  • @arg CAN_FLAG_TXOK1: Transmission OK MailBox 1 Flag
  • @arg CAN_FLAG_ALST1: Arbitration Lost MailBox 1 Flag
  • @arg CAN_FLAG_TERR1: Transmission error MailBox 1 Flag
  • @arg CAN_FLAG_RQCP2: Request complete MailBox 2 Flag
  • @arg CAN_FLAG_TXOK2: Transmission OK MailBox 2 Flag
  • @arg CAN_FLAG_ALST2: Arbitration Lost MailBox 2 Flag
  • @arg CAN_FLAG_TERR2: Transmission error MailBox 2 Flag
  • @arg CAN_FLAG_FF0: RX FIFO 0 Full Flag
  • @arg CAN_FLAG_FOV0: RX FIFO 0 Overrun Flag
  • @arg CAN_FLAG_FF1: RX FIFO 1 Full Flag
  • @arg CAN_FLAG_FOV1: RX FIFO 1 Overrun Flag
  • @arg CAN_FLAG_WKUI: Wake up Interrupt Flag
  • @arg CAN_FLAG_SLAKI: Sleep acknowledge Interrupt Flag
  • @retval None */ #define HAL_CAN_CLEAR_FLAG(HANDLE__, FLAG) \ ((((__FLAG__) >> 8U) == 5U)? (((__HANDLE__)->Instance->TSR) = (1U << ((__FLAG__) & CAN_FLAG_MASK))): \ (((__FLAG__) >> 8U) == 2U)? (((__HANDLE__)->Instance->RF0R) = (1U << ((__FLAG__) & CAN_FLAG_MASK))): \ (((__FLAG__) >> 8U) == 4U)? (((__HANDLE__)->Instance->RF1R) = (1U << ((__FLAG__) & CAN_FLAG_MASK))): \ (((__FLAG__) >> 8U) == 1U)? (((__HANDLE__)->Instance->MSR) = (1U << ((__FLAG__) & CAN_FLAG_MASK))): 0U)

/**

  • @} */

/* Exported functions --------------------------------------------------------*/
/** @addtogroup CAN_Exported_Functions CAN Exported Functions

  • @{ */

/** @addtogroup CAN_Exported_Functions_Group1 Initialization and de-initialization functions

  • @brief Initialization and Configuration functions
  • @{ */

/* Initialization and de-initialization functions *****************************/
HAL_StatusTypeDef HAL_CAN_Init(CAN_HandleTypeDef *hcan);
HAL_StatusTypeDef HAL_CAN_DeInit(CAN_HandleTypeDef *hcan);
void HAL_CAN_MspInit(CAN_HandleTypeDef *hcan);
void HAL_CAN_MspDeInit(CAN_HandleTypeDef *hcan);

/**

  • @} */

/** @addtogroup CAN_Exported_Functions_Group2 Configuration functions

  • @brief Configuration functions
  • @{ */

/* Configuration functions ****************************************************/
HAL_StatusTypeDef HAL_CAN_ConfigFilter(CAN_HandleTypeDef *hcan, CAN_FilterTypeDef *sFilterConfig);

/**

  • @} */

/** @addtogroup CAN_Exported_Functions_Group3 Control functions

  • @brief Control functions
  • @{ */

/* Control functions **********************************************************/
HAL_StatusTypeDef HAL_CAN_Start(CAN_HandleTypeDef *hcan);
HAL_StatusTypeDef HAL_CAN_Stop(CAN_HandleTypeDef *hcan);
HAL_StatusTypeDef HAL_CAN_RequestSleep(CAN_HandleTypeDef *hcan);
HAL_StatusTypeDef HAL_CAN_WakeUp(CAN_HandleTypeDef *hcan);
uint32_t HAL_CAN_IsSleepActive(CAN_HandleTypeDef *hcan);
HAL_StatusTypeDef HAL_CAN_AddTxMessage(CAN_HandleTypeDef *hcan, CAN_TxHeaderTypeDef *pHeader, uint8_t aData[], uint32_t *pTxMailbox);
HAL_StatusTypeDef HAL_CAN_AbortTxRequest(CAN_HandleTypeDef *hcan, uint32_t TxMailboxes);
uint32_t HAL_CAN_GetTxMailboxesFreeLevel(CAN_HandleTypeDef *hcan);
uint32_t HAL_CAN_IsTxMessagePending(CAN_HandleTypeDef *hcan, uint32_t TxMailboxes);
uint32_t HAL_CAN_GetTxTimestamp(CAN_HandleTypeDef *hcan, uint32_t TxMailbox);
HAL_StatusTypeDef HAL_CAN_GetRxMessage(CAN_HandleTypeDef *hcan, uint32_t RxFifo, CAN_RxHeaderTypeDef *pHeader, uint8_t aData[]);
uint32_t HAL_CAN_GetRxFifoFillLevel(CAN_HandleTypeDef *hcan, uint32_t RxFifo);

/**

  • @} */

/** @addtogroup CAN_Exported_Functions_Group4 Interrupts management

  • @brief Interrupts management
  • @{ / / Interrupts management ******************************************************/ HAL_StatusTypeDef HAL_CAN_ActivateNotification(CAN_HandleTypeDef *hcan, uint32_t ActiveITs); HAL_StatusTypeDef HAL_CAN_DeactivateNotification(CAN_HandleTypeDef *hcan, uint32_t InactiveITs); void HAL_CAN_IRQHandler(CAN_HandleTypeDef *hcan);

/**

  • @} */

/** @addtogroup CAN_Exported_Functions_Group5 Callback functions

  • @brief Callback functions
  • @{ / / Callbacks functions ********************************************************/

void HAL_CAN_TxMailbox0CompleteCallback(CAN_HandleTypeDef *hcan);
void HAL_CAN_TxMailbox1CompleteCallback(CAN_HandleTypeDef *hcan);
void HAL_CAN_TxMailbox2CompleteCallback(CAN_HandleTypeDef *hcan);
void HAL_CAN_TxMailbox0AbortCallback(CAN_HandleTypeDef *hcan);
void HAL_CAN_TxMailbox1AbortCallback(CAN_HandleTypeDef *hcan);
void HAL_CAN_TxMailbox2AbortCallback(CAN_HandleTypeDef *hcan);
void HAL_CAN_RxFifo0MsgPendingCallback(CAN_HandleTypeDef *hcan);
void HAL_CAN_RxFifo0FullCallback(CAN_HandleTypeDef *hcan);
void HAL_CAN_RxFifo1MsgPendingCallback(CAN_HandleTypeDef *hcan);
void HAL_CAN_RxFifo1FullCallback(CAN_HandleTypeDef *hcan);
void HAL_CAN_SleepCallback(CAN_HandleTypeDef *hcan);
void HAL_CAN_WakeUpFromRxMsgCallback(CAN_HandleTypeDef *hcan);
void HAL_CAN_ErrorCallback(CAN_HandleTypeDef *hcan);

/**

  • @} */

/** @addtogroup CAN_Exported_Functions_Group6 Peripheral State and Error functions

  • @brief CAN Peripheral State functions
  • @{ / / Peripheral State and Error functions ***************************************/ HAL_CAN_StateTypeDef HAL_CAN_GetState(CAN_HandleTypeDef *hcan); uint32_t HAL_CAN_GetError(CAN_HandleTypeDef *hcan); HAL_StatusTypeDef HAL_CAN_ResetError(CAN_HandleTypeDef *hcan);

/**

  • @} */

/**

  • @} */

/* Private types -------------------------------------------------------------*/
/** @defgroup CAN_Private_Types CAN Private Types

  • @{ */

/**

  • @} */

/* Private variables ---------------------------------------------------------*/
/** @defgroup CAN_Private_Variables CAN Private Variables

  • @{ */

/**

  • @} */

/* Private constants ---------------------------------------------------------*/
/** @defgroup CAN_Private_Constants CAN Private Constants

  • @{ / #define CAN_FLAG_MASK (0x000000FFU) /*
  • @} */

/* Private Macros -----------------------------------------------------------*/
/** @defgroup CAN_Private_Macros CAN Private Macros

  • @{ */

#define IS_CAN_MODE(MODE) (((MODE) == CAN_MODE_NORMAL) || \
((MODE) == CAN_MODE_LOOPBACK)|| \
((MODE) == CAN_MODE_SILENT) || \
((MODE) == CAN_MODE_SILENT_LOOPBACK))
#define IS_CAN_SJW(SJW) (((SJW) == CAN_SJW_1TQ) || ((SJW) == CAN_SJW_2TQ) || \
((SJW) == CAN_SJW_3TQ) || ((SJW) == CAN_SJW_4TQ))
#define IS_CAN_BS1(BS1) (((BS1) == CAN_BS1_1TQ) || ((BS1) == CAN_BS1_2TQ) || \
((BS1) == CAN_BS1_3TQ) || ((BS1) == CAN_BS1_4TQ) || \
((BS1) == CAN_BS1_5TQ) || ((BS1) == CAN_BS1_6TQ) || \
((BS1) == CAN_BS1_7TQ) || ((BS1) == CAN_BS1_8TQ) || \
((BS1) == CAN_BS1_9TQ) || ((BS1) == CAN_BS1_10TQ)|| \
((BS1) == CAN_BS1_11TQ)|| ((BS1) == CAN_BS1_12TQ)|| \
((BS1) == CAN_BS1_13TQ)|| ((BS1) == CAN_BS1_14TQ)|| \
((BS1) == CAN_BS1_15TQ)|| ((BS1) == CAN_BS1_16TQ))
#define IS_CAN_BS2(BS2) (((BS2) == CAN_BS2_1TQ) || ((BS2) == CAN_BS2_2TQ) || \
((BS2) == CAN_BS2_3TQ) || ((BS2) == CAN_BS2_4TQ) || \
((BS2) == CAN_BS2_5TQ) || ((BS2) == CAN_BS2_6TQ) || \
((BS2) == CAN_BS2_7TQ) || ((BS2) == CAN_BS2_8TQ))
#define IS_CAN_PRESCALER(PRESCALER) (((PRESCALER) >= 1U) && ((PRESCALER) <= 1024U))
#define IS_CAN_FILTER_ID_HALFWORD(HALFWORD) ((HALFWORD) <= 0xFFFFU)
#if defined(CAN2)
#define IS_CAN_FILTER_BANK_DUAL(BANK) ((BANK) <= 27U)
#endif
#define IS_CAN_FILTER_BANK_SINGLE(BANK) ((BANK) <= 13U)
#define IS_CAN_FILTER_MODE(MODE) (((MODE) == CAN_FILTERMODE_IDMASK) || \
((MODE) == CAN_FILTERMODE_IDLIST))
#define IS_CAN_FILTER_SCALE(SCALE) (((SCALE) == CAN_FILTERSCALE_16BIT) || \
((SCALE) == CAN_FILTERSCALE_32BIT))
#define IS_CAN_FILTER_ACTIVATION(ACTIVATION) (((ACTIVATION) == CAN_FILTER_DISABLE) || \
((ACTIVATION) == CAN_FILTER_ENABLE))
#define IS_CAN_FILTER_FIFO(FIFO) (((FIFO) == CAN_FILTER_FIFO0) || \
((FIFO) == CAN_FILTER_FIFO1))
#define IS_CAN_TX_MAILBOX(TRANSMITMAILBOX) (((TRANSMITMAILBOX) == CAN_TX_MAILBOX0 ) || \
((TRANSMITMAILBOX) == CAN_TX_MAILBOX1 ) || \
((TRANSMITMAILBOX) == CAN_TX_MAILBOX2 ))
#define IS_CAN_TX_MAILBOX_LIST(TRANSMITMAILBOX) ((TRANSMITMAILBOX) <= (CAN_TX_MAILBOX0 | CAN_TX_MAILBOX1 | CAN_TX_MAILBOX2))
#define IS_CAN_STDID(STDID) ((STDID) <= 0x7FFU)
#define IS_CAN_EXTID(EXTID) ((EXTID) <= 0x1FFFFFFFU)
#define IS_CAN_DLC(DLC) ((DLC) <= 8U)
#define IS_CAN_IDTYPE(IDTYPE) (((IDTYPE) == CAN_ID_STD) || \
((IDTYPE) == CAN_ID_EXT))
#define IS_CAN_RTR(RTR) (((RTR) == CAN_RTR_DATA) || ((RTR) == CAN_RTR_REMOTE))
#define IS_CAN_RX_FIFO(FIFO) (((FIFO) == CAN_RX_FIFO0) || ((FIFO) == CAN_RX_FIFO1))
#define IS_CAN_IT(IT) ((IT) <= (CAN_IT_TX_MAILBOX_EMPTY | CAN_IT_RX_FIFO0_MSG_PENDING | \
CAN_IT_RX_FIFO0_FULL | CAN_IT_RX_FIFO0_OVERRUN | \
CAN_IT_RX_FIFO1_MSG_PENDING | CAN_IT_RX_FIFO1_FULL | \
CAN_IT_RX_FIFO1_OVERRUN | CAN_IT_WAKEUP | \
CAN_IT_SLEEP_ACK | CAN_IT_ERROR_WARNING | \
CAN_IT_ERROR_PASSIVE | CAN_IT_BUSOFF | \
CAN_IT_LAST_ERROR_CODE | CAN_IT_ERROR))

/**

  • @} / / End of private macros -----------------------------------------------------*/

/**

  • @} */

#endif /* CAN1 /
/
*

  • @} */

#ifdef __cplusplus
}
#endif

#endif /* STM32F1xx_HAL_CAN_H */

/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/

求大佬指点哪里错了。。

1个回答

备份,再一步一步查代码

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
使用keil编程第一部就出了问题
想问大家我在用keil输入include“STM32l151C8.h”后显示cannot open source input file,说没有这个文件或目录,这种情况怎么办呀
keil5安装出现这样问题?请问怎么解决?
![图片说明](https://img-ask.csdn.net/upload/202001/04/1578115967_648098.png)
keil使用全局搜索会停止响应
![图片说明](https://img-ask.csdn.net/upload/201912/10/1575958153_345011.png)版本信息如图 每次使用全局搜索都会停止响应,求助。。![图片说明](https://img-ask.csdn.net/upload/201912/10/1575958404_866854.png)
keil error #20 stm32
![图片说明](https://img-ask.csdn.net/upload/201912/27/1577419627_902411.jpg) 刚开始用stm32,还不会用,不了解stm32f10x系列芯片用管脚需要如何配置,望各路大神提点小弟一二
keil5 project 栏叹号咋回事?
![图片说明](https://img-ask.csdn.net/upload/201912/16/1576490164_169717.png)
单片机KEIL出现了different length of parameter lists 的错误,如何修改?
#include<reg51.h> typedef unsigned int u16; typedef unsigned char u8; #define GPIO_DIG P0 #define GPIO_KEY P1 u8 KeyValue; u8 code smgduan[17]={0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07, 0x7f,0x6f,0x77,0x7c,0x39,0x5e,0x79,0x71};//???0~F??? **void delay(u16 i)** { while(i--); } void KeyDown(void) { char a=0; GPIO_KEY=0x0f; if(GPIO_KEY!=0x0f) ![图片说明](https://img-ask.csdn.net/upload/201911/11/1573471052_510016.jpg) 加粗处一直在提示错误,如何修改?
lcd设计电子时钟protues ,keil编程
以AT89C51单片机为核心的时钟,在LCD显示器上显示当前的时间:使用字符型LCD显示器显示当前时间。显示格式为“时时:分分:秒秒”。用4个功能键操作来设置当前时间。功能键K1~K4功能如下。 K1—进入设置现在的时间。 K2—设置小时。 K3—设置分钟。 K4—确认完成设置。 程序执行后工作指示灯LED闪动,表示程序开始执行,LCD显示“00:00:00”,然后开始计时。c语言编程
keil编程,数组方面的一些疑问
uchar code table[]="12345678";这算数组吗?数组初始化不是要用大括号扩起来,用逗号隔开吗?但为什么他可以这样被调用: for(num=0;num<8;num++) LCDdate(table[num]); 如果真的这样的方法可以表示数组,那么他每个数组元素岂不是只可以表示0~9之间的数字?
no debug unit device found 怎么解决
keil5在调试仿真器是遇到的问题 仿真器亮绿灯 这是设备管理器的图片 ![图片说明](https://img-ask.csdn.net/upload/201910/17/1571304875_627024.png) 这是keil5的图片 ![图片说明](https://img-ask.csdn.net/upload/201910/17/1571304931_185264.png) 用的是JTAG仿真器
keil 编程遇到关于数组问题
#include<reg51.h> typedef unsigned int u16; typedef unsigned char u8; #define GPIO_DIG P0 #define GPIO_KEY P1 #define GPIOdongtai_ P3 sbit LSA=P2^2; sbit LSB=P2^3; sbit LSC=P2^4; sbit JIDIANQI=P2^0; sbit FENGMINGQI=P2^1; u8 code smg[8]={0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07}; u8 code b[8]={0,1,2,3,4,5,6,7}; void fengmingqi (); void jidianqi (); void juzhenanjian (u8 a,u8 i); void panduan (u8 a,u8 i); void xianshi (u8 a,u8 j); void delay (u16 i); void main () { u8 a [8]={0,0,0,0,0,0,0,0}; while(1) { u8 t=500000; juzhenanjian(a,8); while(t--) { xianshi(a,8); } panduan(a,8); } } void juzhenanjian (u8 a,u8 i) { u8 cishu=0; u8 key=0; while(cishu<=7) { GPIO_KEY=0x0f; if(GPIO_KEY!=0x0f) { delay(100); cishu++; if(GPIO_KEY!=0x0f) { switch(GPIO_KEY) { case(0X07): key=0;break; case(0X0b): key=1;break; case(0X0d): key=2;break; case(0X0e): key=3;break; } GPIO_KEY=0xf0; switch(GPIO_KEY) { case(0X70): key=key;break; case(0Xb0): key=key+4;break; } while((a<50)&&(GPIO_KEY!=0xf0)) { delay(1000); a++; } } } a[cishu]=key; GPIO_DIG=~smg[key]; } } void xianshi (u8 a,u8 j) { u8 i; for(i=0;i<=7;i++) { switch(a[i]) { case(0): LSA=0;LSB=0;LSC=0; break; case(1): LSA=1;LSB=0;LSC=0; break; case(2): LSA=0;LSB=1;LSC=0; break; case(3): LSA=1;LSB=1;LSC=0; break; case(4): LSA=0;LSB=0;LSC=1; break; case(5): LSA=1;LSB=0;LSC=1; break; case(6): LSA=0;LSB=1;LSC=1; break; case(7): LSA=1;LSB=1;LSC=1; break; } GPIOdongtai_=smg[a[i]]; delay(100); GPIOdongtai_=0x00; } } void panduan (u8 a,u8 t) { u8 kaiguan=0,i=0,j=0; while(a[i]==b[j]) { i++;j++; if(i==8) kaiguan=1; } if(kaiguan) jidianqi(); else if (kaiguan==0) fengmingqi (); } void jidianqi () { JIDIANQI=0; delay(100000); } void fengmingqi () { u8 i=10000; while(i--) { FENGMINGQI=~FENGMINGQI; delay(10); } } void delay (u16 i) { while(i--); } 系统说 a[cishu]=key有错
关于stc可仿真芯片用keil debug调试
为什么,每次编译之后运行debug调试,idata跟xdata数据存储器都不会清除,还是上次运行的值?但data会清楚的!求怎么设置让idata和xdata没次运行都清楚啊!![图片说明](https://img-ask.csdn.net/upload/201705/22/1495455283_314947.png)![图片说明](https://img-ask.csdn.net/upload/201705/22/1495455010_600325.png)![图片说明](https://img-ask.csdn.net/upload/201705/22/1495455321_200881.png)
51单片机编程sbit与#define的区别
在keil编程中: #define dula P2^6不对 而必须sbit dula=P2^6; 请问为何?
关于keil中头文件无法打开
最近在搞keil相关的东西,先遇到一问题,想向各位大神们请教! 我在Keil uVision4中新建了一个工程,添加了一个.c文件,其中包含#include<boebot.h>,但是问题出现了说不能打开。 请问是什么问题?
keil c51 和keil v6.12有什么区别
我需要下载的keil版本为v6.12,但在keil官网上只能买到keil c51,请问这两个有区别吗?可以买c51吗?(用于单片机编程)主要是我买的书上使用的版本为v6.12
keil中能不能调用web service服务?
大家好,现在在开发一套系统,需要实现软件与硬件的数据传输,硬件使用keil编程,采用c或者C++ ,然后把程序拷入cortex M3中,不知道能不能调用web service,希望大家告知
keil5打开keil4工程后编译出现问题怎么办?
keil5打开keil4工程出现这样的情况,编译后出现"no source": Error: #5: cannot open source input file "..\source\crc32.c": No such file or directory的问题?
keil软件编译stm32固件库出错,自己改的固件库
.\Objects\leddiyi.axf: Error: L6200E: Symbol WWDG_IRQHandler multiply defined (by startup_stm32f10x_hd_vl.o and startup_stm32f10x_cl.o). .\Objects\leddiyi.axf: Error: L6200E: Symbol WWDG_IRQHandler multiply defined (by startup_stm32f10x_ld.o and startup_stm32f10x_cl.o). .\Objects\leddiyi.axf: Error: L6200E: Symbol WWDG_IRQHandler multiply defined (by startup_stm32f10x_ld_vl.o and startup_stm32f10x_cl.o). .\Objects\leddiyi.axf: Error: L6200E: Symbol WWDG_IRQHandler multiply defined (by startup_stm32f10x_md.o and startup_stm32f10x_cl.o). .\Objects\leddiyi.axf: Error: L6200E: Symbol WWDG_IRQHandler multiply defined (by startup_stm32f10x_md_vl.o and startup_stm32f10x_cl.o). .\Objects\leddiyi.axf: Error: L6200E: Symbol WWDG_IRQHandler multiply defined (by startup_stm32f10x_xl.o and startup_stm32f10x_cl.o). .\Objects\leddiyi.axf: Error: L6200E: Symbol ADC3_IRQHandler multiply defined (by startup_stm32f10x_xl.o and startup_stm32f10x_hd.o). .\Objects\leddiyi.axf: Error: L6200E: Symbol DMA2_Channel4_5_IRQHandler multiply defined (by startup_stm32f10x_hd_vl.o and startup_stm32f10x_hd.o). .\Objects\leddiyi.axf: Error: L6200E: Symbol DMA2_Channel4_5_IRQHandler multiply defined (by startup_stm32f10x_xl.o and startup_stm32f10x_hd.o). .\Objects\leddiyi.axf: Error: L6200E: Symbol FSMC_IRQHandler multiply defined (by startup_stm32f10x_xl.o and startup_stm32f10x_hd.o). .\Objects\leddiyi.axf: Error: L6200E: Symbol SDIO_IRQHandler multiply defined (by startup_stm32f10x_xl.o and startup_stm32f10x_hd.o). .\Objects\leddiyi.axf: Error: L6200E: Symbol TIM8_CC_IRQHandler multiply defined (by startup_stm32f10x_xl.o and startup_stm32f10x_hd.o). .\Objects\leddiyi.axf: Error: L6200E: Symbol USBWakeUp_IRQHandler multiply defined (by startup_stm32f10x_ld.o and startup_stm32f10x_hd.o). .\Objects\leddiyi.axf: Error: L6200E: Symbol USBWakeUp_IRQHandler multiply defined (by startup_stm32f10x_md.o and startup_stm32f10x_hd.o). .\Objects\leddiyi.axf: Error: L6200E: Symbol USBWakeUp_IRQHandler multiply defined (by startup_stm32f10x_xl.o and startup_stm32f10x_hd.o). .\Objects\leddiyi.axf: Error: L6200E: Symbol USB_HP_CAN1_TX_IRQHandler multiply defined (by startup_stm32f10x_ld.o and startup_stm32f10x_hd.o). .\Objects\leddiyi.axf: Error: L6200E: Symbol USB_HP_CAN1_TX_IRQHandler multiply defined (by startup_stm32f10x_md.o and startup_stm32f10x_hd.o). .\Objects\leddiyi.axf: Error: L6200E: Symbol USB_HP_CAN1_TX_IRQHandler multiply defined (by startup_stm32f10x_xl.o and startup_stm32f10x_hd.o). .\Objects\leddiyi.axf: Error: L6200E: Symbol USB_LP_CAN1_RX0_IRQHandler multiply defined (by startup_stm32f10x_ld.o and startup_stm32f10x_hd.o). .\Objects\leddiyi.axf: Error: L6200E: Symbol USB_LP_CAN1_RX0_IRQHandler multiply defined (by startup_stm32f10x_md.o and startup_stm32f10x_hd.o). .\Objects\leddiyi.axf: Error: L6200E: Symbol USB_LP_CAN1_RX0_IRQHandler multiply defined (by startup_stm32f10x_xl.o and startup_stm32f10x_hd.o). .\Objects\leddiyi.axf: Error: L6200E: Symbol ADC1_IRQHandler multiply defined (by startup_stm32f10x_ld_vl.o and startup_stm32f10x_hd_vl.o). .\Objects\leddiyi.axf: Error: L6200E: Symbol ADC1_IRQHandler multiply defined (by startup_stm32f10x_md_vl.o and startup_stm32f10x_hd_vl.o). .\Objects\leddiyi.axf: Error: L6200E: Symbol CEC_IRQHandler multiply defined (by startup_stm32f10x_ld_vl.o and startup_stm32f10x_hd_vl.o). .\Objects\leddiyi.axf: Error: L6200E: Symbol CEC_IRQHandler multiply defined (by startup_stm32f10x_md_vl.o and startup_stm32f10x_hd_vl.o). .\Objects\leddiyi.axf: Error: L6200E: Symbol TIM1_BRK_TIM15_IRQHandler multiply defined (by startup_stm32f10x_ld_vl.o and startup_stm32f10x_hd_vl.o).都是这样的错误340个
stm32 如何在 KEIL 中 建立内部 EEPROM HEX 文件
我以前用过51,会建立两个project target,一个是CORE 用来跑main(),一个EEPROM 里面只有一个eeprom.c 里面没有函数只有一个u8数组,烧写的时候会把eeprom.hex中的数组下载到单片机的类eeprom中,然后主程序初始化的时候将eeprom.c 数组中的数据全部读出来,并按照相应地址映射到变量中,今天在STM32上研究很久建立eeprom工程,所以我也同样只在eeprom.c中定义一个数组,没有定义其他函数,也没有加启动文件,于是出现下面的错误 ..\OBJ\eeprom.sct(7): error: L6236E: No section matches selector - no section to be FIRST/LAST.,有没有哪位大神知道的帮帮忙指导下谢谢。
关于keil软件卸载的一点提问。。。
小弟不才,昨天装了两个keil软件。一个keil uversion2,一个keil5。。当卸载keil2时,他提示找不到相关模块,当卸载keil5时,删除成功但安装目录下的文件并没有被完全删除。。。。求大神,指点一二。。。
爬虫福利二 之 妹子图网MM批量下载
爬虫福利一:27报网MM批量下载    点击 看了本文,相信大家对爬虫一定会产生强烈的兴趣,激励自己去学习爬虫,在这里提前祝:大家学有所成! 目标网站:妹子图网 环境:Python3.x 相关第三方模块:requests、beautifulsoup4 Re:各位在测试时只需要将代码里的变量 path 指定为你当前系统要保存的路径,使用 python xxx.py 或IDE运行即可。
字节跳动视频编解码面经
引言 本文主要是记录一下面试字节跳动的经历。 三四月份投了字节跳动的实习(图形图像岗位),然后hr打电话过来问了一下会不会opengl,c++,shador,当时只会一点c++,其他两个都不会,也就直接被拒了。 七月初内推了字节跳动的提前批,因为内推没有具体的岗位,hr又打电话问要不要考虑一下图形图像岗,我说实习投过这个岗位不合适,不会opengl和shador,然后hr就说秋招更看重基础。我当时
开源一个功能完整的SpringBoot项目框架
福利来了,给大家带来一个福利。 最近想了解一下有关Spring Boot的开源项目,看了很多开源的框架,大多是一些demo或者是一个未成形的项目,基本功能都不完整,尤其是用户权限和菜单方面几乎没有完整的。 想到我之前做的框架,里面通用模块有:用户模块,权限模块,菜单模块,功能模块也齐全了,每一个功能都是完整的。 打算把这个框架分享出来,供大家使用和学习。 为什么用框架? 框架可以学习整体
小白如何学习java?
在博主认为,对于入门级学习java的最佳学习方法莫过于视频+博客+书籍+总结,前三者博主将淋漓尽致地挥毫于这篇博客文章中,至于总结在于个人,实际上越到后面你会发现学习的最好方式就是阅读参考官方文档其次就是国内的书籍,博客次之,这又是一个层次了,这里暂时不提后面再谈。博主将为各位入门java保驾护航,各位只管冲鸭!!!上天是公平的,只要不辜负时间,时间自然不会辜负你。 何谓学习?博主所理解的学习,它
程序员必须掌握的核心算法有哪些?
由于我之前一直强调数据结构以及算法学习的重要性,所以就有一些读者经常问我,数据结构与算法应该要学习到哪个程度呢?,说实话,这个问题我不知道要怎么回答你,主要取决于你想学习到哪些程度,不过针对这个问题,我稍微总结一下我学过的算法知识点,以及我觉得值得学习的算法。这些算法与数据结构的学习大多数是零散的,并没有一本把他们全部覆盖的书籍。下面是我觉得值得学习的一些算法以及数据结构,当然,我也会整理一些看过
程序员接私活怎样防止做完了不给钱?
首先跟大家说明一点,我们做 IT 类的外包开发,是非标品开发,所以很有可能在开发过程中会有这样那样的需求修改,而这种需求修改很容易造成扯皮,进而影响到费用支付,甚至出现做完了项目收不到钱的情况。 那么,怎么保证自己的薪酬安全呢? 我们在开工前,一定要做好一些证据方面的准备(也就是“讨薪”的理论依据),这其中最重要的就是需求文档和验收标准。一定要让需求方提供这两个文档资料作为开发的基础。之后开发
Python十大装B语法
Python 是一种代表简单思想的语言,其语法相对简单,很容易上手。不过,如果就此小视 Python 语法的精妙和深邃,那就大错特错了。本文精心筛选了最能展现 Python 语法之精妙的十个知识点,并附上详细的实例代码。如能在实战中融会贯通、灵活使用,必将使代码更为精炼、高效,同时也会极大提升代码B格,使之看上去更老练,读起来更优雅。 1. for - else 什么?不是 if 和 else 才
数据库优化 - SQL优化
前面一篇文章从实例的角度进行数据库优化,通过配置一些参数让数据库性能达到最优。但是一些“不好”的SQL也会导致数据库查询变慢,影响业务流程。本文从SQL角度进行数据库优化,提升SQL运行效率。 判断问题SQL 判断SQL是否有问题时可以通过两个表象进行判断: 系统级别表象 CPU消耗严重 IO等待严重 页面响应时间过长
2019年11月中国大陆编程语言排行榜
2019年11月2日,我统计了某招聘网站,获得有效程序员招聘数据9万条。针对招聘信息,提取编程语言关键字,并统计如下: 编程语言比例 rank pl_ percentage 1 java 33.62% 2 c/c++ 16.42% 3 c_sharp 12.82% 4 javascript 12.31% 5 python 7.93% 6 go 7.25% 7
通俗易懂地给女朋友讲:线程池的内部原理
餐厅的约会 餐盘在灯光的照耀下格外晶莹洁白,女朋友拿起红酒杯轻轻地抿了一小口,对我说:“经常听你说线程池,到底线程池到底是个什么原理?”我楞了一下,心里想女朋友今天是怎么了,怎么突然问出这么专业的问题,但做为一个专业人士在女朋友面前也不能露怯啊,想了一下便说:“我先给你讲讲我前同事老王的故事吧!” 大龄程序员老王 老王是一个已经北漂十多年的程序员,岁数大了,加班加不动了,升迁也无望,于是拿着手里
经典算法(5)杨辉三角
杨辉三角 是经典算法,这篇博客对它的算法思想进行了讲解,并有完整的代码实现。
腾讯算法面试题:64匹马8个跑道需要多少轮才能选出最快的四匹?
昨天,有网友私信我,说去阿里面试,彻底的被打击到了。问了为什么网上大量使用ThreadLocal的源码都会加上private static?他被难住了,因为他从来都没有考虑过这个问题。无独有偶,今天笔者又发现有网友吐槽了一道腾讯的面试题,我们一起来看看。 腾讯算法面试题:64匹马8个跑道需要多少轮才能选出最快的四匹? 在互联网职场论坛,一名程序员发帖求助到。二面腾讯,其中一个算法题:64匹
面试官:你连RESTful都不知道我怎么敢要你?
面试官:了解RESTful吗? 我:听说过。 面试官:那什么是RESTful? 我:就是用起来很规范,挺好的 面试官:是RESTful挺好的,还是自我感觉挺好的 我:都挺好的。 面试官:… 把门关上。 我:… 要干嘛?先关上再说。 面试官:我说出去把门关上。 我:what ?,夺门而去 文章目录01 前言02 RESTful的来源03 RESTful6大原则1. C-S架构2. 无状态3.统一的接
为啥国人偏爱Mybatis,而老外喜欢Hibernate/JPA呢?
关于SQL和ORM的争论,永远都不会终止,我也一直在思考这个问题。昨天又跟群里的小伙伴进行了一番讨论,感触还是有一些,于是就有了今天这篇文。 声明:本文不会下关于Mybatis和JPA两个持久层框架哪个更好这样的结论。只是摆事实,讲道理,所以,请各位看官勿喷。 一、事件起因 关于Mybatis和JPA孰优孰劣的问题,争论已经很多年了。一直也没有结论,毕竟每个人的喜好和习惯是大不相同的。我也看
SQL-小白最佳入门sql查询一
一 说明 如果是初学者,建议去网上寻找安装Mysql的文章安装,以及使用navicat连接数据库,以后的示例基本是使用mysql数据库管理系统; 二 准备前提 需要建立一张学生表,列分别是id,名称,年龄,学生信息;本示例中文章篇幅原因SQL注释略; 建表语句: CREATE TABLE `student` ( `id` int(11) NOT NULL AUTO_INCREMENT, `
项目中的if else太多了,该怎么重构?
介绍 最近跟着公司的大佬开发了一款IM系统,类似QQ和微信哈,就是聊天软件。我们有一部分业务逻辑是这样的 if (msgType = "文本") { // dosomething } else if(msgType = "图片") { // doshomething } else if(msgType = "视频") { // doshomething } else { // dosho
致 Python 初学者
文章目录1. 前言2. 明确学习目标,不急于求成,不好高骛远3. 在开始学习 Python 之前,你需要做一些准备2.1 Python 的各种发行版2.2 安装 Python2.3 选择一款趁手的开发工具3. 习惯使用IDLE,这是学习python最好的方式4. 严格遵从编码规范5. 代码的运行、调试5. 模块管理5.1 同时安装了py2/py35.2 使用Anaconda,或者通过IDE来安装模
“狗屁不通文章生成器”登顶GitHub热榜,分分钟写出万字形式主义大作
一、垃圾文字生成器介绍 最近在浏览GitHub的时候,发现了这样一个骨骼清奇的雷人项目,而且热度还特别高。 项目中文名:狗屁不通文章生成器 项目英文名:BullshitGenerator 根据作者的介绍,他是偶尔需要一些中文文字用于GUI开发时测试文本渲染,因此开发了这个废话生成器。但由于生成的废话实在是太过富于哲理,所以最近已经被小伙伴们给玩坏了。 他的文风可能是这样的: 你发现,...
程序员:我终于知道post和get的区别
是一个老生常谈的话题,然而随着不断的学习,对于以前的认识有很多误区,所以还是需要不断地总结的,学而时习之,不亦说乎
羞,Java 字符串拼接竟然有这么多姿势
二哥,我今年大二,看你分享的《阿里巴巴 Java 开发手册》上有一段内容说:“循环体内,拼接字符串最好使用 StringBuilder 的 append 方法,而不是 + 号操作符。”到底为什么啊,我平常一直就用的‘+’号操作符啊!二哥有空的时候能否写一篇文章分析一下呢? 就在昨天,一位叫小菜的读者微信我说了上面这段话。 我当时看到这条微信的第一感觉是:小菜你也太菜了吧,这都不知道为啥啊!我估
"狗屁不通文章生成器"登顶GitHub热榜,分分钟写出万字形式主义大作
GitHub 被誉为全球最大的同性交友网站,……,陪伴我们已经走过 10+ 年时间,它托管了大量的软件代码,同时也承载了程序员无尽的欢乐。 万字申请,废话报告,魔幻形式主义大作怎么写?兄dei,狗屁不通文章生成器了解一下。这个富有灵魂的项目名吸引了众人的目光。项目仅仅诞生一周,便冲上了GitHub趋势榜榜首(Js中文网 -前端进阶资源教程)、是榜首哦
推荐几款比较实用的工具,网站
1.盘百度PanDownload   这个云盘工具是免费的,可以进行资源搜索,提速(偶尔会抽风......) 不要去某站买付费的......   PanDownload下载地址   2.BeJSON 这是一款拥有各种在线工具的网站,推荐它的主要原因是网站简洁,功能齐全,广告相比其他广告好太多了     bejson网站   3.二维码美化 这个网站的二维码美化很好看,网站界面
《程序人生》系列-这个程序员只用了20行代码就拿了冠军
你知道的越多,你不知道的越多 点赞再看,养成习惯GitHub上已经开源https://github.com/JavaFamily,有一线大厂面试点脑图,欢迎Star和完善 前言 这一期不算《吊打面试官》系列的,所有没前言我直接开始。 絮叨 本来应该是没有这期的,看过我上期的小伙伴应该是知道的嘛,双十一比较忙嘛,要值班又要去帮忙拍摄年会的视频素材,还得搞个程序员一天的Vlog,还要写BU...
程序员把地府后台管理系统做出来了,还有3.0版本!12月7号最新消息:已在开发中有github地址
第一幕:缘起 听说阎王爷要做个生死簿后台管理系统,我们派去了一个程序员…… 996程序员做的梦: 第一场:团队招募 为了应对地府管理危机,阎王打算找“人”开发一套地府后台管理系统,于是就在地府总经办群中发了项目需求。 话说还是中国电信的信号好,地府都是满格,哈哈!!! 经常会有外行朋友问:看某网站做的不错,功能也简单,你帮忙做一下? 而这次,面对这样的需求,这个程序员...
网易云6亿用户音乐推荐算法
网易云音乐是音乐爱好者的集聚地,云音乐推荐系统致力于通过 AI 算法的落地,实现用户千人千面的个性化推荐,为用户带来不一样的听歌体验。 本次分享重点介绍 AI 算法在音乐推荐中的应用实践,以及在算法落地过程中遇到的挑战和解决方案。 将从如下两个部分展开: AI算法在音乐推荐中的应用 音乐场景下的 AI 思考 从 2013 年 4 月正式上线至今,网易云音乐平台持续提供着:乐屏社区、UGC...
8年经验面试官详解 Java 面试秘诀
作者 |胡书敏 责编 | 刘静 出品 | CSDN(ID:CSDNnews) 本人目前在一家知名外企担任架构师,而且最近八年来,在多家外企和互联网公司担任Java技术面试官,前后累计面试了有两三百位候选人。在本文里,就将结合本人的面试经验,针对Java初学者、Java初级开发和Java开发,给出若干准备简历和准备面试的建议。 Java程序员准备和投递简历的实...
面试官如何考察你的思维方式?
1.两种思维方式在求职面试中,经常会考察这种问题:北京有多少量特斯拉汽车?某胡同口的煎饼摊一年能卖出多少个煎饼?深圳有多少个产品经理?一辆公交车里能装下多少个乒乓球?一个正常成年人有多少根头发?这类估算问题,被称为费米问题,是以科学家费米命名的。为什么面试会问这种问题呢?这类问题能把两类人清楚地区分出来。一类是具有文科思维的人,擅长赞叹和模糊想象,它主要依靠的是人的第一反应和直觉,比如小孩...
碎片化的时代,如何学习
今天周末,和大家聊聊学习这件事情。 在如今这个社会,我们的时间被各类 APP 撕的粉碎。 刷知乎、刷微博、刷朋友圈; 看论坛、看博客、看公号; 等等形形色色的信息和知识获取方式一个都不错过。 貌似学了很多,但是却感觉没什么用。 要解决上面这些问题,首先要分清楚一点,什么是信息,什么是知识。 那什么是信息呢? 你一切听到的、看到的,都是信息,比如微博上的明星出轨、微信中的表情大战、抖音上的段子
so easy! 10行代码写个"狗屁不通"文章生成器
前几天,GitHub 有个开源项目特别火,只要输入标题就可以生成一篇长长的文章。 背后实现代码一定很复杂吧,里面一定有很多高深莫测的机器学习等复杂算法 不过,当我看了源代码之后 这程序不到50行 尽管我有多年的Python经验,但我竟然一时也没有看懂 当然啦,原作者也说了,这个代码也是在无聊中诞生的,平时撸码是不写中文变量名的, 中文...
知乎高赞:中国有什么拿得出手的开源软件产品?(整理自本人原创回答)
知乎高赞:中国有什么拿得出手的开源软件产品? 在知乎上,有个问题问“中国有什么拿得出手的开源软件产品(在 GitHub 等社区受欢迎度较好的)?” 事实上,还不少呢~ 本人于2019.7.6进行了较为全面的回答,对这些受欢迎的 Github 开源项目分类整理如下: 分布式计算、云平台相关工具类 1.SkyWalking,作者吴晟、刘浩杨 等等 仓库地址: apache/skywalking 更...
相关热词 如何提升c#开发能力 矩阵乘法c# c#调用谷歌浏览器 c# 去空格去转义符 c#用户登录窗体代码 c# 流 c# linux 可视化 c# mvc 返回图片 c# 像素空间 c# 日期 最后一天
立即提问