stm32f103的spi主模式使用硬件nss输出,是不是有BUG,不能自动拉低拉高?

RT !
SPI_SSOutputCmd(SPIx, ENABLE);_执行之后 NSS引脚就一直拉低,不会出现自动先拉低,再拉高的情况。这是不是stm32f103的BUG?
如果是103的bug,那么,stm32f2xx f3xx f4xx f7xx 的SPI主模式 硬件NSS输出正常吗?也会不会存在这个BUG

1个回答

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
STM32F407 SPI的SPI1->DR寄存器值不变
![图片说明](https://img-ask.csdn.net/upload/201504/18/1429340098_960264.jpg) 如图寄存器状态,不知道怎么回事,网上也搜不到类似的问题>.<;; 理论上,执行 SPIx->DR = Data;后SPI的SR寄存器应该变为SPIx->SR=0x0000(我的所有脚都悬空),但是结果却是SPIx->SR=0x0003,而且DR的值不变任然是SPIx->DR=0x0000。 不知道怎么回事啊,小弟接触arm没多久,谢谢啦! 下面是部分代码,SPI初始化和main函数。 ``` //main.c SPI2Init(); STM_EVAL_LEDInit(LED4); STM_EVAL_LEDInit(LED5); u32 temp=0; STM_EVAL_LEDToggle(LED4); while(!SPI_I2S_GetFlagStatus(SPI1,SPI_I2S_FLAG_TXE)); SPI_I2S_SendData(SPI1,0x11); temp=0xfffff; while(temp) {temp--;} temp=0; //SPI1Init.c void SPI1Init(void){ GPIO_InitTypeDef GPIO_InitStructure; SPI_InitTypeDef SPI_InitStructure; // Enable the SPI periph RCC_APB2PeriphClockCmd(RCC_APB2Periph_SPI1, ENABLE); // Enable SCK, MOSI and MISO GPIO clocks RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOB,ENABLE); // Enable CS GPIO clock RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOA,ENABLE); GPIO_PinAFConfig(GPIOB,GPIO_PinSource3,GPIO_AF_SPI1); GPIO_PinAFConfig(GPIOB,GPIO_PinSource4,GPIO_AF_SPI1); GPIO_PinAFConfig(GPIOB,GPIO_PinSource5,GPIO_AF_SPI1); GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF; GPIO_InitStructure.GPIO_OType = GPIO_OType_PP; GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_DOWN; GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz; GPIO_InitStructure.GPIO_Pin = GPIO_Pin_3; GPIO_Init(GPIOB,&GPIO_InitStructure); GPIO_InitStructure.GPIO_Pin = GPIO_Pin_4; GPIO_Init(GPIOB,&GPIO_InitStructure); GPIO_InitStructure.GPIO_Pin = GPIO_Pin_5; GPIO_Init(GPIOB,&GPIO_InitStructure); SPI_InitStructure.SPI_Direction = SPI_Direction_2Lines_FullDuplex; SPI_InitStructure.SPI_Mode = SPI_Mode_Master; SPI_InitStructure.SPI_DataSize = SPI_DataSize_8b; SPI_InitStructure.SPI_CPOL = SPI_CPOL_High; SPI_InitStructure.SPI_CPHA = SPI_CPHA_2Edge; SPI_InitStructure.SPI_NSS = SPI_NSS_Soft; SPI_InitStructure.SPI_BaudRatePrescaler = SPI_BaudRatePrescaler_256; SPI_InitStructure.SPI_FirstBit = SPI_FirstBit_MSB; SPI_InitStructure.SPI_CRCPolynomial = 7; SPI_Init(SPI1, &SPI_InitStructure); SPI_Cmd(SPI1, ENABLE); //Configure GPIO PIN for Lis Chip select GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT; GPIO_InitStructure.GPIO_OType = GPIO_OType_PP; GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz; GPIO_InitStructure.GPIO_Pin = GPIO_Pin_15; GPIO_Init(GPIOA,&GPIO_InitStructure); //Deselect : Chip Select high GPIO_SetBits(GPIOA, GPIO_Pin_15); } ```
关于stm32中的spi1_nss功能
大家好,最近碰到一个问题想跟大家讨论一下。如图,flash 的cs引脚连到CPU的spi1_nss引脚,问题来了,如何将cs引脚拉低?(除了使用GPIO直接置位)![图片说明](https://img-ask.csdn.net/upload/201708/14/1502708358_354924.png)![图片说明](https://img-ask.csdn.net/upload/201708/14/1502708363_321807.png)
有关使用stm32中spi3的问题
我在使用stm32中的spi3来驱动tlc2543的时候不成功,看了好久不知道是哪里出了问题,请大神们帮忙看看 void SPI3_Init(void) { GPIO_InitTypeDef GPIO_InitStructure; SPI_InitTypeDef SPI_InitStructure; RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOB,ENABLE );//PORTBʱÖÓʹÄÜ RCC_APB1PeriphClockCmd(RCC_APB1Periph_SPI3,ENABLE );//SPI2ʱÖÓʹÄÜ GPIO_InitStructure.GPIO_Pin = GPIO_Pin_3;//PB3ÊÇSCLK,PB4ÊÇOUT£¬PB5ÊÇÊäÈ룬PE2-6ÊÇCS1-5 GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF_PP; //PB13/14/15¸´ÓÃÍÆÍìÊä³ö GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz; GPIO_Init(GPIOB, &GPIO_InitStructure);//³õʼ»¯GPIOB GPIO_InitStructure.GPIO_Pin=GPIO_Pin_5; GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF_PP; GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz; GPIO_Init(GPIOB, &GPIO_InitStructure);//³õʼ»¯GPIOB GPIO_InitStructure.GPIO_Pin=GPIO_Pin_4; GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN_FLOATING ; GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz; GPIO_Init(GPIOB, &GPIO_InitStructure);//³õʼ»¯GPIOB // GPIO_SetBits(GPIOB,GPIO_Pin_3|GPIO_Pin_4|GPIO_Pin_5); //PB13/14/15ÉÏÀ­ SPI_Cmd(SPI3, DISABLE); SPI_InitStructure.SPI_Direction = SPI_Direction_2Lines_FullDuplex; //ÉèÖÃSPIµ¥Ïò»òÕßË«ÏòµÄÊý¾Ýģʽ:SPIÉèÖÃΪ˫ÏßË«ÏòÈ«Ë«¹¤ SPI_InitStructure.SPI_Mode = SPI_Mode_Master; //ÉèÖÃSPI¹¤×÷ģʽ:ÉèÖÃΪÖ÷SPI SPI_InitStructure.SPI_DataSize = SPI_DataSize_16b; //ÉèÖÃSPIµÄÊý¾Ý´óС:SPI·¢ËͽÓÊÕ8λ֡½á¹¹ SPI_InitStructure.SPI_CPOL = SPI_CPOL_Low; //´®ÐÐͬ²½Ê±ÖӵĿÕÏÐ״̬ΪµÍµçƽ SPI_InitStructure.SPI_CPHA = SPI_CPHA_1Edge; //´®ÐÐͬ²½Ê±Öӵĵڶþ¸öÌø±äÑØ£¨ÉÏÉý»òϽµ£©Êý¾Ý±»²ÉÑù£¬cpha=0£¬ SPI_InitStructure.SPI_NSS = SPI_NSS_Soft; //NSSÐźÅÓÉÓ²¼þ£¨NSS¹Ü½Å£©»¹ÊÇÈí¼þ£¨Ê¹ÓÃSSI룩¹ÜÀí:ÄÚ²¿NSSÐźÅÓÐSSIλ¿ØÖÆ SPI_InitStructure.SPI_BaudRatePrescaler = SPI_BaudRatePrescaler_256; //¶¨Ò岨ÌØÂÊÔ¤·ÖƵµÄÖµ:²¨ÌØÂÊÔ¤·ÖƵֵΪ256 SPI_InitStructure.SPI_FirstBit = SPI_FirstBit_MSB; //Ö¸¶¨Êý¾Ý´«Êä´ÓMSBλ»¹ÊÇLSBλ¿ªÊ¼:Êý¾Ý´«Êä´ÓMSBλ¿ªÊ¼ SPI_InitStructure.SPI_CRCPolynomial = 7; //CRCÖµ¼ÆËãµÄ¶àÏîʽ SPI_Init(SPI3, &SPI_InitStructure); //¸ù¾ÝSPI_InitStructÖÐÖ¸¶¨µÄ²ÎÊý³õʼ»¯ÍâÉèSPIx¼Ä´æÆ÷ SPI_Cmd(SPI3, ENABLE); //ʹÄÜSPIÍâÉè // SPI3_ReadWriteByte(0xff);
两个ARM间的SPI通信怎么实现?ARM型号均为STM32F429ZIT。
发送时,采取的函数为HAL_SPI_Transmit_IT(); 接收时,由于不知道对方发过来的报文长度, 就不知道用什么函数。厂家提供的软件包里面的receive函数都需要 指定size长度。 下面的代码中,我在最开始开启SPI_IT_RXNE中断使能。 通过中断函数和数据处理函数来解析报文。并把报文上传网络服务器。 但是ARM SPI接收不到数据。不知道为啥? 本代码为SPI主机的。 /* SPI5 init function */ void MX_SPI5_Init(void) { hspi5.Instance = SPI5; hspi5.Init.Mode = SPI_MODE_MASTER; hspi5.Init.Direction = SPI_DIRECTION_2LINES; hspi5.Init.DataSize = SPI_DATASIZE_8BIT; hspi5.Init.CLKPolarity = SPI_POLARITY_LOW; hspi5.Init.CLKPhase = SPI_PHASE_1EDGE; hspi5.Init.NSS = SPI_NSS_SOFT; hspi5.Init.BaudRatePrescaler = SPI_BAUDRATEPRESCALER_4; hspi5.Init.FirstBit = SPI_FIRSTBIT_MSB; hspi5.Init.TIMode = SPI_TIMODE_DISABLED; hspi5.Init.CRCCalculation = SPI_CRCCALCULATION_DISABLED; HAL_SPI_Init(&hspi5); } /** * @brief Initializes the SPI according to the specified parameters * in the SPI_InitTypeDef and create the associated handle. * @param hspi: pointer to a SPI_HandleTypeDef structure that contains * the configuration information for SPI module. * @retval HAL status */ HAL_StatusTypeDef HAL_SPI_Init(SPI_HandleTypeDef *hspi) { ..... HAL_SPI_MspInit(hspi); ...... } void HAL_SPI_MspInit(SPI_HandleTypeDef* hspi) { GPIO_InitTypeDef GPIO_InitStruct; if(hspi->Instance==SPI4) { /* Peripheral clock enable */ __SPI4_CLK_ENABLE(); /**SPI4 GPIO Configuration PE2 ------> SPI4_SCK PE5 ------> SPI4_MISO PE6 ------> SPI4_MOSI */ GPIO_InitStruct.Pin = GPIO_PIN_2|GPIO_PIN_5|GPIO_PIN_6; GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; GPIO_InitStruct.Pull = GPIO_NOPULL; GPIO_InitStruct.Speed = GPIO_SPEED_LOW; GPIO_InitStruct.Alternate = GPIO_AF5_SPI4; HAL_GPIO_Init(GPIOE, &GPIO_InitStruct); } if(hspi->Instance==SPI5) { /* Peripheral clock enable */ __SPI5_CLK_ENABLE(); /**SPI5 GPIO Configuration PF7 ------> SPI5_SCK PF8 ------> SPI5_MISO PF9 ------> SPI5_MOSI */ GPIO_InitStruct.Pin = GPIO_PIN_7|GPIO_PIN_8|GPIO_PIN_9; GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; GPIO_InitStruct.Pull = GPIO_NOPULL; GPIO_InitStruct.Speed = GPIO_SPEED_LOW; GPIO_InitStruct.Alternate = GPIO_AF5_SPI5; HAL_GPIO_Init(GPIOF, &GPIO_InitStruct); } } main() { MX_SPI5_Init(); __HAL_SPI_ENABLE_IT(&hspi5, SPI_IT_RXNE); while (1) { SPI5_Master_Rx(); //读取从机发过来的数据。 } } typedef uint8_t u8 ; typedef uint16_t u16 ; typedef uint32_t u32 ; u8 hmosi[50]={0}; u8 mosi1[50]={0}; u8 phmosi[50]={0}; u32 imosi=0; u32 spi5_rx_len; u32 ic=0; #define comsize 8 extern u16 tSession; u32 udata_len_spi; extern u16 ports[comsize+1]; extern u32 uTimeLst; extern SPI_HandleTypeDef hspi5; void SPI5_IRQHandler(void) { if(__HAL_SPI_GET_FLAG(&hspi5, SPI_FLAG_RXNE) == SET) { hmosi[imosi++]=(uint8_t)(hspi5.Instance->DR); } } void SPI5_Master_Rx(void) { //for(;imosi>=(ic+7);ic++) for(;imosi>=(ic+5);ic++) { if((0x2e==hmosi[ic])&&(0x17==hmosi[ic+1])&&(0x0==hmosi[ic+2])) { spi5_rx_len=hmosi[ic+6]; udata_len_spi = spi5_rx_len+1; memset(phmosi,0x00,udata_len_spi); phmosi[5]=hmosi[ic+5]; phmosi[6]=spi5_rx_len-7; memcpy(phmosi+7,hmosi+ic+7,spi5_rx_len-7); memcpy(mosi1,hmosi+ic,50-ic); memcpy(hmosi,mosi1,50-ic); imosi=imosi-ic; ic=0; //************************** tSession++; phmosi[0]=0x2e; phmosi[1]=0x17; phmosi[2]=0x00; phmosi[3]=tSession; phmosi[4]=(tSession>>8); //memcpy(udata+7,tx1_buf,rx1cnt); phmosi[udata_len_spi-1] = crc(phmosi,udata_len_spi-1,1); com2net(ports[0],udata_len_spi,phmosi); uTimeLst=HAL_GetTick(); } } }
在STM32上做SPI方式的ADXL345程序,无法读出ID,全是FF?
![图片说明](https://img-ask.csdn.net/upload/201906/27/1561593720_113653.jpg) 我用的ADXL345在淘宝上买的,型号是GY291 #ifndef __SPI_H #define __SPI_H #include "sys.h" void SPI1_Init(void); //初始化SPI1口 void SPI1_SetSpeed(u8 SpeedSet); //设置SPI1速度 u8 SPI1_ReadWriteByte(u8 TxData);//SPI1总线读写一个字节 #endif #include "spi.h" #include "delay.h" //以下是SPI模块的初始化代码,配置成主机模式 //SPI口初始化 //这里针是对SPI1的初始化 void SPI1_Init(void) { GPIO_InitTypeDef GPIO_InitStructure; SPI_InitTypeDef SPI_InitStructure; RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOA, ENABLE);//使能GPIOA时钟 RCC_APB2PeriphClockCmd(RCC_APB2Periph_SPI1, ENABLE);//使能SPI1时钟 //GPIOFA5,6,7初始化设置 GPIO_InitStructure.GPIO_Pin = GPIO_Pin_5|GPIO_Pin_6|GPIO_Pin_7|GPIO_Pin_4;//PA4片选 GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF;//复用功能 GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;//推挽输出 GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;//100MHz GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP;//上拉 GPIO_Init(GPIOA, &GPIO_InitStructure);//初始化 GPIO_PinAFConfig(GPIOA,GPIO_PinSource5,GPIO_AF_SPI1); //PB3复用为 SPI1 GPIO_PinAFConfig(GPIOA,GPIO_PinSource6,GPIO_AF_SPI1); //PB4复用为 SPI1 GPIO_PinAFConfig(GPIOA,GPIO_PinSource7,GPIO_AF_SPI1); //PB5复用为 SPI1 //这里只针对SPI口初始化 RCC_APB2PeriphResetCmd(RCC_APB2Periph_SPI1,ENABLE);//复位SPI1 RCC_APB2PeriphResetCmd(RCC_APB2Periph_SPI1,DISABLE);//停止复位SPI1 SPI_InitStructure.SPI_Direction = SPI_Direction_2Lines_FullDuplex; //设置SPI单向或者双向的数据模式:SPI设置为双线双向全双工 SPI_InitStructure.SPI_Mode = SPI_Mode_Master; //设置SPI工作模式:设置为主SPI SPI_InitStructure.SPI_DataSize = SPI_DataSize_8b; //设置SPI的数据大小:SPI发送接收8位帧结构 SPI_InitStructure.SPI_CPOL = SPI_CPOL_High; //串行同步时钟的空闲状态为高电平 SPI_InitStructure.SPI_CPHA = SPI_CPHA_2Edge; //串行同步时钟的第二个跳变沿(上升或下降)数据被采样 SPI_InitStructure.SPI_NSS = SPI_NSS_Soft; //NSS信号由硬件(NSS管脚)还是软件(使用SSI位)管理:内部NSS信号有SSI位控制 SPI_InitStructure.SPI_BaudRatePrescaler = SPI_BaudRatePrescaler_256; //定义波特率预分频的值:波特率预分频值为256 SPI_InitStructure.SPI_FirstBit = SPI_FirstBit_MSB; //指定数据传输从MSB位还是LSB位开始:数据传输从MSB位开始 SPI_InitStructure.SPI_CRCPolynomial = 7; //CRC值计算的多项式 SPI_Init(SPI1, &SPI_InitStructure); //根据SPI_InitStruct中指定的参数初始化外设SPIx寄存器 GPIO_SetBits(GPIOA,GPIO_Pin_4); SPI_Cmd(SPI1, ENABLE); //使能SPI外设 // SPI1_ReadWriteByte(0xff);//启动传输 } //SPI1速度设置函数 //SPI速度=fAPB2/分频系数 //@ref SPI_BaudRate_Prescaler:SPI_BaudRatePrescaler_2~SPI_BaudRatePrescaler_256 //fAPB2时钟一般为84Mhz: /* 初始化包括了spi速度在内的各种参数,而速度设置函数,则只设置SPI的速度,方便在代码里面调用. 比如sd卡例程,在SD卡初始化的时候,SPI频率必须比较低,但是初始化成功以后,就可以设置到很高了. 这个时候调用SPI速度设置函数,就比较方便. */ void SPI1_SetSpeed(u8 SPI_BaudRatePrescaler) { assert_param(IS_SPI_BAUDRATE_PRESCALER(SPI_BaudRatePrescaler));//判断有效性 SPI1->CR1&=0XFFC7;//位3-5清零,用来设置波特率 SPI1->CR1|=SPI_BaudRatePrescaler; //设置SPI1速度 SPI_Cmd(SPI1,ENABLE); //使能SPI1 } //SPI1 读写一个字节 //TxData:要写入的字节 //返回值:读取到的字节 u8 SPI1_ReadWriteByte(u8 TxData) { u8 val,val1; GPIO_ResetBits(GPIOA,GPIO_Pin_4); delay_ms(2); while (SPI_I2S_GetFlagStatus(SPI1, SPI_I2S_FLAG_TXE) == RESET){}//等待发送区空 SPI_I2S_SendData(SPI1, TxData); //通过外设SPIx发送一个byte 数据 while (SPI_I2S_GetFlagStatus(SPI1, SPI_I2S_FLAG_RXNE) == RESET){} //等待接收完一个byte val1=SPI_I2S_ReceiveData(SPI1); GPIO_SetBits(GPIOA,GPIO_Pin_4); delay_ms(2); GPIO_ResetBits(GPIOA,GPIO_Pin_4); delay_ms(2); while (SPI_I2S_GetFlagStatus(SPI1, SPI_I2S_FLAG_TXE) == RESET){}//等待发送区空 SPI_I2S_SendData(SPI1, 0XFF); //通过外设SPIx发送一个byte 数据 while (SPI_I2S_GetFlagStatus(SPI1, SPI_I2S_FLAG_RXNE) == RESET){} //等待接收完一个byte val=SPI_I2S_ReceiveData(SPI1); GPIO_SetBits(GPIOA,GPIO_Pin_4); return val+val1; //返回通过SPIx最近接收的数据 } #ifndef __ADXL345_H #define __ADXL345_H #include "spi.h" #define DEVICE_ID 0X00 //器件ID,0XE5 #define THRESH_TAP 0X1D //敲击阀值 #define OFSX 0X1E #define OFSY 0X1F #define OFSZ 0X20 #define DUR 0X21 #define Latent 0X22 #define Window 0X23 #define THRESH_ACK 0X24 //有误,THRESH_ACT #define THRESH_INACT 0X25 #define TIME_INACT 0X26 #define ACT_INACT_CTL 0X27 #define THRESH_FF 0X28 #define TIME_FF 0X29 #define TAP_AXES 0X2A #define ACT_TAP_STATUS 0X2B #define BW_RATE 0X2C #define POWER_CTL 0X2D #define INT_ENABLE 0X2E #define INT_MAP 0X2F #define INT_SOURCE 0X30 #define DATA_FORMAT 0X31 #define DATA_X0 0X32 #define DATA_X1 0X33 #define DATA_Y0 0X34 #define DATA_Y1 0X35 #define DATA_Z0 0X36 #define DATA_Z1 0X37 #define FIFO_CTL 0X38 #define FIFO_STATUS 0X39 u8 ADXL345_Init(void); //初始化ADXL345 u8 SPI1_ReadWriteByte(u8 TxData);//SPI1总线读写一个字节 #endif #include "adxl345.h" #include "sys.h" #include "delay.h" #include "math.h" #include "usart.h" //初始化ADXL345. //返回值:0,初始化成功;1,初始化失败. u8 ADXL345_Init(void) { u8 ID; SPI1_Init(); //初始化IIC总线 if(SPI1_ReadWriteByte(DEVICE_ID)==0XE5) //读取器件ID { printf("\r\nDEVICE_ID=%0x",ID); return 0; } printf("\r\n失败DEVICE_ID=%0x",ID); return 1; } //读ADXL345寄存器 //addr:寄存器地址 //返回值:读到的值 #include "sys.h" #include "usart.h" #include "delay.h" #include "led.h" #include "key.h" #include "lcd.h" #include "adxl345.h" #include "math.h" int main(void) { delay_init(168); //初始化延时函数 uart_init(115200); //初始化串口波特率为115200 LED_Init(); //初始化与LED连接的硬件接口 while(1) { while(ADXL345_Init()) //3D加速度传感器初始化 { delay_ms(1000); } } } ```
STM32 SPI2使用DMA接收,DMA接收完成后不进DMA中断???
//Configuration SPI2 of CCPU2MCU RCC_AHB1PeriphClockCmd(PROTOCOL_SPI_PORT_CLK,ENABLE); //使能GPIO B口的时钟 RCC_APB1PeriphClockCmd(PROTOCOL_SPI_CLK, ENABLE); //使能SPI2 时钟 GPIO_PinAFConfig(PROTOCOL_SPI_CS_PORT, PROTOCOL_SPI_CS_PIN_SRC, GPIO_AF_SPI2); GPIO_PinAFConfig(PROTOCOL_SPI_SCK_PORT, PROTOCOL_SPI_SCK_PIN_SRC, GPIO_AF_SPI2); GPIO_PinAFConfig(PROTOCOL_SPI_MISO_PORT, PROTOCOL_SPI_MISO_PIN_SRC, GPIO_AF_SPI2); GPIO_PinAFConfig(PROTOCOL_SPI_MOSI_PORT, PROTOCOL_SPI_MOSI_PIN_SRC, GPIO_AF_SPI2); GPIO_InitStructure.GPIO_Pin = PROTOCOL_SPI_CS_PIN; GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF; GPIO_InitStructure.GPIO_Speed = GPIO_Speed_100MHz; GPIO_InitStructure.GPIO_OType = GPIO_OType_PP; GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL; GPIO_Init(PROTOCOL_SPI_CS_PORT, &GPIO_InitStructure); GPIO_InitStructure.GPIO_Pin = PROTOCOL_SPI_SCK_PIN; GPIO_Init(PROTOCOL_SPI_SCK_PORT, &GPIO_InitStructure); GPIO_InitStructure.GPIO_Pin = PROTOCOL_SPI_MOSI_PIN; GPIO_Init(PROTOCOL_SPI_MOSI_PORT, &GPIO_InitStructure); GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT; GPIO_InitStructure.GPIO_Speed = GPIO_Speed_100MHz; GPIO_InitStructure.GPIO_OType = GPIO_OType_PP; GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP; GPIO_InitStructure.GPIO_Pin = PROTOCOL_SPI_MISO_PIN; GPIO_Init(PROTOCOL_SPI_MISO_PORT, &GPIO_InitStructure); SPI_InitStructure.SPI_Direction = SPI_Direction_2Lines_FullDuplex; SPI_InitStructure.SPI_Mode = SPI_Mode_Slave; SPI_InitStructure.SPI_DataSize = SPI_DataSize_8b; SPI_InitStructure.SPI_CPOL = SPI_CPOL_Low; SPI_InitStructure.SPI_CPHA = SPI_CPHA_1Edge; SPI_InitStructure.SPI_NSS = SPI_NSS_Hard; SPI_InitStructure.SPI_BaudRatePrescaler = SPI_BaudRatePrescaler_4; SPI_InitStructure.SPI_FirstBit = SPI_FirstBit_MSB; SPI_InitStructure.SPI_CRCPolynomial = 0x07; SPI_Init(SPI2, &SPI_InitStructure); SPI_Cmd(SPI2, ENABLE); // Configuration DMA1 DMA_InitTypeDef DMA_InitStructure; NVIC_InitTypeDef NVIC_InitStructure; RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_DMA1, ENABLE); DMA_DeInit(DMA1_Stream3); //SPI2 Rx DMA_InitStructure.DMA_Channel = DMA_Channel_0; DMA_InitStructure.DMA_PeripheralBaseAddr = (u32)(&(SPI2->DR)); DMA_InitStructure.DMA_Memory0BaseAddr = (u32)(&USART_RX_DMA_Buf[0]); DMA_InitStructure.DMA_DIR = DMA_DIR_PeripheralToMemory; DMA_InitStructure.DMA_BufferSize = 16384+6; //32768+6; DMA_InitStructure.DMA_PeripheralInc = DMA_PeripheralInc_Disable; DMA_InitStructure.DMA_MemoryInc = DMA_MemoryInc_Enable; DMA_InitStructure.DMA_PeripheralDataSize = DMA_PeripheralDataSize_Byte; DMA_InitStructure.DMA_MemoryDataSize = DMA_MemoryDataSize_Byte; DMA_InitStructure.DMA_Mode = DMA_Mode_Normal; DMA_InitStructure.DMA_Priority = DMA_Priority_High; DMA_InitStructure.DMA_FIFOMode = DMA_FIFOMode_Disable; DMA_InitStructure.DMA_FIFOThreshold = DMA_FIFOThreshold_HalfFull; DMA_InitStructure.DMA_MemoryBurst = DMA_MemoryBurst_Single; DMA_InitStructure.DMA_PeripheralBurst = DMA_PeripheralBurst_Single; DMA_Init(DMA1_Stream3, &DMA_InitStructure); SPI_I2S_DMACmd(SPI2, SPI_I2S_DMAReq_Rx, ENABLE); DMA_ClearITPendingBit(DMA1_Stream3,DMA_IT_TCIF3); DMA_ITConfig(DMA1_Stream3,DMA_IT_TC,ENABLE); NVIC_PriorityGroupConfig(NVIC_PriorityGroup_0); NVIC_InitStructure.NVIC_IRQChannel = DMA1_Stream3_IRQn; NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 0; NVIC_InitStructure.NVIC_IRQChannelSubPriority = 0; NVIC_InitStructure.NVIC_IRQChannel = ENABLE; NVIC_Init(&NVIC_InitStructure); DMA_Cmd(DMA1_Stream3, ENABLE); // DMA Interrupt void DMA1_Stream3_IRQHandler(void) { unsigned int len; len = 0; if(DMA_GetITStatus(DMA1_Stream3, DMA_IT_TCIF3) != RESET) { DMA_ClearITPendingBit(DMA1_Stream3,DMA_IT_TCIF3); DMA_Cmd(DMA1_Stream3,DISABLE); spiRxFlag = 1; DMA_SetCurrDataCounter(DMA1_Stream3, 16384+6); DMA_Cmd(DMA1_Stream3, ENABLE); } }
STM32F103和RC522模块通信,为什么M1卡无回应?
从网上下载的代码例程,可以正确运行,运行,硬件方面没问题,但我根据需要作出修改后,就无法读卡了。 源程序是如下连线 /******************************* *1--SS <----->PF0 //普通GPIO *2--SCK <----->PB13 *3--MOSI<----->PB15 *4--MISO<----->PB14 *5--IRQ 悬空 *6--GND <----->GND *7--RST <----->PF1 //普通GPIO *8--VCC <----->VCC ************************************/ 我修改成了 /******************************* *1--SS <----->PB12 //SPI的NSS口 *2--SCK <----->PB13 *3--MOSI<----->PB15 *4--MISO<----->PB14 *5--IRQ 悬空 *6--GND <----->GND *7--RST <----->PA8 //普通GPIO *8--VCC <----->VCC ************************************/ 初始化配置下 void SPI2_Init(void) { GPIO_InitTypeDef GPIO_InitStructure; SPI_InitTypeDef SPI_InitStructure; RCC_APB2PeriphClockCmd( RCC_APB2Periph_GPIOB|RCC_APB2Periph_GPIOA, ENABLE ); RCC_APB1PeriphClockCmd( RCC_APB1Periph_SPI2, ENABLE ); GPIO_InitStructure.GPIO_Pin = GPIO_Pin_8; //PA8 -> RST GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP; GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz; GPIO_Init(GPIOA, &GPIO_InitStructure); GPIO_ResetBits(GPIOA,GPIO_Pin_8); GPIO_InitStructure.GPIO_Pin = GPIO_Pin_13 | GPIO_Pin_14 | GPIO_Pin_15; GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF_PP; GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz; GPIO_Init(GPIOB, &GPIO_InitStructure); GPIO_SetBits(GPIOB,GPIO_Pin_13|GPIO_Pin_14|GPIO_Pin_15); SPI_InitStructure.SPI_Direction = SPI_Direction_2Lines_FullDuplex; SPI_InitStructure.SPI_Mode = SPI_Mode_Master; SPI_InitStructure.SPI_DataSize = SPI_DataSize_8b; SPI_InitStructure.SPI_CPOL = SPI_CPOL_Low; SPI_InitStructure.SPI_CPHA = SPI_CPHA_1Edge; SPI_InitStructure.SPI_NSS = SPI_NSS_Soft; SPI_InitStructure.SPI_BaudRatePrescaler = SPI_BaudRatePrescaler_256; SPI_InitStructure.SPI_FirstBit = SPI_FirstBit_MSB; SPI_InitStructure.SPI_CRCPolynomial = 7; SPI_Init(SPI2, &SPI_InitStructure); SPI_Cmd(SPI2, ENABLE); GPIO_InitStructure.GPIO_Pin = GPIO_Pin_12; //PB12 -> SS GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP; GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz; GPIO_Init(GPIOB, &GPIO_InitStructure); GPIO_SetBits(GPIOB,GPIO_Pin_12); } 下面是我修改的位操作 #define SET_SPI_CS (GPIOB->BSRR = 0X1000) //PB12 -> 1 #define CLR_SPI_CS (GPIOB->BRR = 0X1000) //PB12 -> 0 #define SET_RC522RST GPIOA->BSRR = 0X0100 //PA8 -> 1 #define CLR_RC522RST GPIOA->BRR = 0X0100 //PA8 -> 0 不知道我这么修改可不可以,反正M1卡就是不理我
STM32用MCP2515与另一块STM32通讯失败
大家,我最近在调试SPI转CAN模块MCP2515;我用jink查看配置寄存器,都没错,就是死活发不了数据,求助下大家; MCP2515和STM32zet6的SPI2连接: SPI程序设置为主机: //////////////////////////////////////////////////////////////////////////////////////////////////// GPIO_InitTypeDef GPIO_InitStructure; SPI_InitTypeDef SPI_InitStructure; RCC_APB2PeriphClockCmd( RCC_APB2Periph_GPIOB, ENABLE );//PORTB时钟使能 RCC_APB1PeriphClockCmd( RCC_APB1Periph_SPI2, ENABLE );//SPI2时钟使能 GPIO_InitStructure.GPIO_Pin = GPIO_Pin_13 | GPIO_Pin_14 | GPIO_Pin_15; GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF_PP; //PB13/14/15复用推挽输出 GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz; GPIO_Init(GPIOB, &GPIO_InitStructure);//初始化GPIOB // GPIO_SetBits(GPIOB,GPIO_Pin_13|GPIO_Pin_14|GPIO_Pin_15); //PB13/14/15上拉 SPI_InitStructure.SPI_Direction = SPI_Direction_2Lines_FullDuplex; //设置SPI单向或者双向的数据模式:SPI设置为双线双向全双工 SPI_InitStructure.SPI_BaudRatePrescaler = SPI_BaudRatePrescaler_256; //定义波特率预分频的值:波特率预分频值为256 SPI_InitStructure.SPI_DataSize = SPI_DataSize_8b; //设置SPI的数据大小:SPI发送接收8位帧结构 SPI_InitStructure.SPI_CPOL = SPI_CPOL_High; //串行同步时钟的空闲状态为高电平 SPI_InitStructure.SPI_CPHA = SPI_CPHA_2Edge; //串行同步时钟的第二个跳变沿(上升或下降)数据被采样 SPI_InitStructure.SPI_NSS = SPI_NSS_Soft; //NSS信号由硬件(NSS管脚)还是软件(使用SSI位)管理:内部NSS信号有SSI位控制 SPI_InitStructure.SPI_BaudRatePrescaler = SPI_BaudRatePrescaler_256; //定义波特率预分频的值:波特率预分频值为256 SPI_InitStructure.SPI_FirstBit = SPI_FirstBit_MSB; //指定数据传输从MSB位还是LSB位开始:数据传输从MSB位开始 SPI_InitStructure.SPI_CRCPolynomial = 7; //CRC值计算的多项式 SPI_InitStructure.SPI_Mode = SPI_Mode_Master; SPI_Init(SPI2, &SPI_InitStructure); //根据SPI_InitStruct中指定的参数初始化外设SPIx寄存器 SPI_Cmd(SPI2, ENABLE); //使能SPI外设 SPI2_ReadWriteByte(0xff);//启动传输 spi发送代码: u8 retry=0; while (SPI_I2S_GetFlagStatus(SPI2, SPI_I2S_FLAG_TXE) == RESET) //检查指定的SPI标志位设置与否:发送缓存空标志位 { retry++; if(retry>200)return 0; } SPI_I2S_SendData(SPI2, TxData); //通过外设SPIx发送一个数据 retry=0; while (SPI_I2S_GetFlagStatus(SPI2, SPI_I2S_FLAG_RXNE) == RESET) //检查指定的SPI标志位设置与否:接受缓存非空标志位 { retry++; if(retry>200)return 0; } return SPI_I2S_ReceiveData(SPI2); //返回通过SPIx最近接收的数据 mcp2515初始化代码:--------------------------------------------------------------------------------- SPIByteWrite(CANCTRL,0x80); //MCP2515复位,进入配置模式 delay_ms(1); /*--------初始化接收过滤器,接收屏蔽器-----*/ SPIByteWrite(RXM0SIDH,0x00); SPIByteWrite(RXM0SIDL,0x00); //屏蔽器 SPIByteWrite(RXF0SIDH,0x00); //过滤器 SPIByteWrite(RXF0SIDL,0x00); /*-------------*/ //设置波特率为125Kbps ,共16个tq //set CNF1,SJW=00,长度为1TQ,BRP=1,TQ=[2*(BRP+1)]/Fsoc=2*2/8M=0.5us SPIByteWrite(CNF1,0x01); //set CNF2,SAM=0,在采样点对总线进行一次采样,PHSEG1=(6+1)TQ=7TQ,PRSEG=(1+1)TQ=2TQ SPIByteWrite(CNF2,0xB1); //set CNF3,PHSEG2=(5+1)TQ=6TQ,同时当CANCTRL.CLKEN=1时设定CLKOUT引脚为时间输出使能位 SPIByteWrite(CNF3,0x05); //set TXB0,设置发送缓冲器0的标识符和发送的数据,以及发送的数据长度 SPIByteWrite(TXB0SIDH,0x00);//设置发送缓冲器0的标准标识符,待修改*** SPIByteWrite(TXB0SIDL,0x00);//用到标准标识符 /*set TXB1 SPIByteWrite(TXB1SIDH,0x50); //Set TXB0 SIDH SPIByteWrite(TXB1SIDL,0x00); //Set TXB0 SIDL SPIByteWrite(TXB1DLC,0x40 | DLC_8); //Set DLC = 3 bytes and RTR bit*/ //设置接收缓冲器0的标识符和初始化数据 SPIByteWrite(RXB0SIDH,0x00);//设置接收缓冲器0的标准标识符,待修改*** SPIByteWrite(RXB0SIDL,0x60);//用到标准标识符 SPIByteWrite(RXB0CTRL,0x60);//仅仅接收标准标识符的有效信息,FIILHIT0=0表示RXB0 ,采用FILHIT0 SPIByteWrite(RXB0DLC,DLC_8);//设置接收数据的长度为8个字节 SPIByteWrite(RXF0SIDH,0x00);//初始化接收滤波器0,待修改*** SPIByteWrite(RXF0SIDL,0x00); SPIByteWrite(RXM0SIDH,0xFF);//初始化接收屏蔽器0,待修改*** SPIByteWrite(CANCTRL,REQOP_NORMAL|CLKOUT_ENABLED);//设置正常模式 dummy=SPIByteRead(CANSTAT); //如果还处于配置模式,就进入工作模式配置 if(OPMODE_NORMAL!=(dummy&&0xE0)) { SPIByteWrite(CANCTRL,REQOP_NORMAL|CLKOUT_ENABLED);//判断进入正常工作模式 } 这是MCP2515发送函数:----------------------------------------------------------------- unsigned char tempdata,j; tempdata=SPIByteRead(CAN_RD_STATUS); SPIByteWrite(TXB0DLC,length1); for(j=0;j<length1;j++) { SPIByteWrite(TXB0D0+j,CAN_TX_Buf[j]); } if(tempdata&0x04)//判断TXREQ标志位 { delay_ms(1); SPIByteWrite(TXB0CTRL,0);//清除TXREQ标志位 while(SPIByteRead(CAN_RD_STATUS)&0x04);//等待TXREQ清零 } CS=0; WriteSPI(CAN_RTS_TXB0);//发送缓冲器0请求发送 CS=1; 这是主函数:---我主要是通过mcp2515发送数据给另外一块stm32: int key=0; delay_init(); LED_Init(); SPI2_Init(); MCP_2515_init(); while(1) { CAN_Send_anylength(buf,0x08); delay_ms(1000); } 以上就是主要代码,完全是看手册的还有厂家给的代码,就是不通,求大神帮忙看看,谢谢,
请问STM32L0K6芯片的SPI的收发数据的问题
问题描述:配置好SPI后,然后通过SPI给AS3956芯片收发数据,第一次正常收发成功。 但后续的收发,则接收数据均为0X00(第一次调试,图见后面)。 复位后,继续调试,接收的数据均为0xFF(第二次调试,图见后面)。 谁知道这个问题的解决方案吗? 下面是我的代码: ``` /* 宏定义 */ #define CS_LOW() { HAL_GPIO_WritePin(GPIOA, GPIO_PIN_4, GPIO_PIN_RESET);} #define CS_HIGH() { HAL_GPIO_WritePin(GPIOA, GPIO_PIN_4, GPIO_PIN_SET);} /* 收发数据 */ CS_LOW(); if(HAL_OK==HAL_SPI_TransmitReceive(&hspi1,&pTxData1,&pRxData2,1, 10)) { if(HAL_OK!=HAL_SPI_TransmitReceive(&hspi1,(uint8_t *)0xff,&pRxData1,1, 10)) { return -1; } } CS_HIGH(); CS_LOW(); if(HAL_OK!=HAL_SPI_TransmitReceive(&hspi1,&pTxData2,&pRxData2,1, 10)) { return -1; } CS_HIGH(); CS_LOW(); if(HAL_OK!=HAL_SPI_TransmitReceive(&hspi1,&pTxData3,&pRxData2,1, 10)) { return -1; } CS_HIGH(); /* SPI1 parameter configuration*/ hspi1.Instance = SPI1; hspi1.Init.Mode = SPI_MODE_MASTER; hspi1.Init.Direction = SPI_DIRECTION_2LINES; hspi1.Init.DataSize = SPI_DATASIZE_8BIT; hspi1.Init.CLKPolarity = SPI_POLARITY_LOW; hspi1.Init.CLKPhase = SPI_PHASE_1EDGE; hspi1.Init.NSS = SPI_NSS_SOFT; hspi1.Init.BaudRatePrescaler = SPI_BAUDRATEPRESCALER_2; hspi1.Init.FirstBit = SPI_FIRSTBIT_MSB; hspi1.Init.TIMode = SPI_TIMODE_DISABLE; hspi1.Init.CRCCalculation = SPI_CRCCALCULATION_DISABLE; hspi1.Init.CRCPolynomial = 7; if (HAL_SPI_Init(&hspi1) != HAL_OK) { _Error_Handler(__FILE__, __LINE__); } ``` ![第一次调试](https://img-ask.csdn.net/upload/201905/14/1557804076_56872.png) 第一次调试图 ![第二次调试](https://img-ask.csdn.net/upload/201905/14/1557804107_804381.png) 第二次调试图(复位后)
SPI的NSS管脚是双向的io口吗?既可以输入也可以输出,
图中的输入是电平给自己什么意思,这是什么类型的io口呢?可以举个例子吗![图片说明](https://img-ask.csdn.net/upload/201511/07/1446877680_782830.png)
这样的coredump如何定位问题,求大神指导
# 一个服务程序,平均一天挂一次,coredump内容都已一样,分析不出来 ``` c++ Program terminated with signal 11, Segmentation fault. #0 SLL_Next (t=0x2) at src/linked_list.h:45 45 src/linked_list.h: No such file or directory. Missing separate debuginfos, use: debuginfo-install glibc-2.17-260.el7.x86_64 keyutils-libs-1.5.8-3.el7.x86_64 krb5-libs-1.15.1-34.el7.x86_64 libcom_err-1.42.9-13.el7.x86_64 libgcc-4.8.5-36.el7.x86_64 libselinux-2.5-14.1.el7.x86_64 libstdc++-4.8.5-36.el7.x86_64 nspr-4.19.0-1.el7_5.x86_64 nss-3.36.0-7.el7_5.x86_64 openldap-2.4.44-20.el7.x86_64 pcre-8.32-17.el7.x86_64 zlib-1.2.7-18.el7.x86_64 (gdb) bt #0 SLL_Next (t=0x2) at src/linked_list.h:45 #1 SLL_TryPop (rv=<synthetic pointer>, list=0x1f9c080) at src/linked_list.h:69 #2 TryPop (rv=<synthetic pointer>, this=0x1f9c080) at src/thread_cache.h:220 #3 Allocate (cl=4, size=48, this=<optimized out>) at src/thread_cache.h:381 #4 malloc_fast_path<tcmalloc::allocate_full_cpp_throw_oom> (size=<optimized out>) at src/tcmalloc.cc:1751 #5 tc_new (size=<optimized out>) at src/tcmalloc.cc:1851 #6 0x00007fd6bf3bca19 in std::string::_Rep::_S_create(unsigned long, unsigned long, std::allocator<char> const&) () from /lib64/libstdc++.so.6 #7 0x00007fd6c2c3842d in char* std::string::_S_construct<char const*>(char const*, char const*, std::allocator<char> const&, std::forward_iterator_tag) () from ./lib/libcpprest.so.2.10 #8 0x00007fd6bf3be6d8 in std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(char const*, std::allocator<char> const&) () from /lib64/libstdc++.so.6 #9 0x000000000069b836 in InformationCommand::Process (this=0x7ec8a38, task=..., response=@0x7fd58890f3f8: 0x0) at src/modules/DataCommand/InformationCommand.cpp:74 #10 0x0000000000724c62 in ThreadPoolGateway::task (this=0x252bda0, task=0x3b792f0) at src/modules/Servers/impl/ThreadPoolGateway.cpp:115 #11 0x0000000000726306 in boost::_mfi::mf1<void, ThreadPoolGateway, HDConstants::TaskDef*>::operator() (this=0x606ac40, p=0x252bda0, a1=0x3b792f0) at /usr/local/include/boost/bind/mem_fn_template.hpp:165 #12 0x00000000007261fd in boost::_bi::list2<boost::_bi::value<ThreadPoolGateway*>, boost::_bi::value<HDConstants::TaskDef*> >::operator()<boost::_mfi::mf1<void, ThreadPoolGateway, HDConstants::TaskDef*>, boost::_bi::list0> (this=0x606ac50, f=..., a=...) at /usr/local/include/boost/bind/bind.hpp:319 #13 0x0000000000725fc5 in boost::_bi::bind_t<void, boost::_mfi::mf1<void, ThreadPoolGateway, HDConstants::TaskDef*>, boost::_bi::list2<boost::_bi::value<ThreadPoolGateway*>, boost::_bi::value<HDConstants::TaskDef*> > >::operator() (this=0x606ac40) at /usr/local/include/boost/bind/bind.hpp:1294 #14 0x0000000000725eea in boost::detail::function::void_function_obj_invoker0<boost::_bi::bind_t<void, boost::_mfi::mf1<void, ThreadPoolGateway, HDConstants::TaskDef*>, boost::_bi::list2<boost::_bi::value<ThreadPoolGateway*>, boost::_bi::value<HDConstants::TaskDef*> > >, void>::invoke (function_obj_ptr=...) at /usr/local/include/boost/function/function_template.hpp:159 #15 0x0000000000660f7e in boost::function0<void>::operator() (this=0x7fd58890fa80) at /usr/local/include/boost/function/function_template.hpp:760 ---Type <return> to continue, or q <return> to quit--- #16 0x000000000067cc94 in boost::threadpool::detail::pool_core<boost::function0<void>, boost::threadpool::fifo_scheduler, boost::threadpool::static_size, boost::threadpool::resize_controller, boost::threadpool::wait_for_all_tasks>::execute_task (this=0x258c180) at /usr/local/include/boost/threadpool/detail/pool_core.hpp:440 #17 0x000000000067bd44 in boost::threadpool::detail::worker_thread<boost::threadpool::detail::pool_core<boost::function0<void>, boost::threadpool::fifo_scheduler, boost::threadpool::static_size, boost::threadpool::resize_controller, boost::threadpool::wait_for_all_tasks> >::run (this=0x25a0150) at /usr/local/include/boost/threadpool/detail/worker_thread.hpp:82 #18 0x000000000067f4ee in boost::_mfi::mf0<void, boost::threadpool::detail::worker_thread<boost::threadpool::detail::pool_core<boost::function0<void>, boost::threadpool::fifo_scheduler, boost::threadpool::static_size, boost::threadpool::resize_controller, boost::threadpool::wait_for_all_tasks> > >::call<boost::shared_ptr<boost::threadpool::detail::worker_thread<boost::threadpool::detail::pool_core<boost::function0<void>, boost::threadpool::fifo_scheduler, boost::threadpool::static_size, boost::threadpool::resize_controller, boost::threadpool::wait_for_all_tasks> > > > (this=0x2571298, u=...) at /usr/local/include/boost/bind/mem_fn_template.hpp:40 #19 0x000000000067f473 in boost::_mfi::mf0<void, boost::threadpool::detail::worker_thread<boost::threadpool::detail::pool_core<boost::function0<void>, boost::threadpool::fifo_scheduler, boost::threadpool::static_size, boost::threadpool::resize_controller, boost::threadpool::wait_for_all_tasks> > >::operator()<boost::shared_ptr<boost::threadpool::detail::worker_thread<boost::threadpool::detail::pool_core<boost::function0<void>, boost::threadpool::fifo_scheduler, boost::threadpool::static_size, boost::threadpool::resize_controller, boost::threadpool::wait_for_all_tasks> > > > (this=0x2571298, u=...) at /usr/local/include/boost/bind/mem_fn_template.hpp:55 #20 0x000000000067f41e in boost::_bi::list1<boost::_bi::value<boost::shared_ptr<boost::threadpool::detail::worker_thread<boost::threadpool::detail::pool_core<boost::function0<void>, boost::threadpool::fifo_scheduler, boost::threadpool::static_size, boost::threadpool::resize_controller, boost::threadpool::wait_for_all_tasks> > > > >::operator()<boost::_mfi::mf0<void, boost::threadpool::detail::worker_thread<boost::threadpool::detail::pool_core<boost::function0<void>, boost::threadpool::fifo_scheduler, boost::threadpool::static_size, boost::threadpool::resize_controller, boost::threadpool::wait_for_all_tasks> > >, boost::_bi::list0> (this=0x25712a8, f=..., a=...) at /usr/local/include/boost/bind/bind.hpp:259 #21 0x000000000067f303 in boost::_bi::bind_t<void, boost::_mfi::mf0<void, boost::threadpool::detail::worker_thread<boost::threadpool::detail::pool_core<boost::function0<void>, boost::threadpool::fifo_scheduler, boost::threadpool::static_size, boost::threadpool::resize_controller, boost::threadpool::wait_for_all_tasks> > >, boost::_bi::list1<boost::_bi::value<boost::shared_ptr<boost::threadpool::detail::worker_thread<boost::threadpool::detail::pool_core<boost::function0<void>, boost::threadpool::fifo_scheduler, boost::threadpool::static_size, boost::threadpool::resize_controller, boost::threadpool::wait_for_all_tasks> > > > > >::operator() (this=0x2571298) at /usr/local/include/boost/bind/bind.hpp:1294 #22 0x000000000067f0ee in boost::detail::thread_data<boost::_bi::bind_t<void, boost::_mfi::mf0<void, boost::threadpool::detail::worker_---Type <return> to continue, or q <return> to quit--- thread<boost::threadpool::detail::pool_core<boost::function0<void>, boost::threadpool::fifo_scheduler, boost::threadpool::static_size, boost::threadpool::resize_controller, boost::threadpool::wait_for_all_tasks> > >, boost::_bi::list1<boost::_bi::value<boost::shared_ptr<boost::threadpool::detail::worker_thread<boost::threadpool::detail::pool_core<boost::function0<void>, boost::threadpool::fifo_scheduler, boost::threadpool::static_size, boost::threadpool::resize_controller, boost::threadpool::wait_for_all_tasks> > > > > > >::run ( this=0x25710e0) at /usr/local/include/boost/thread/detail/thread.hpp:116 #23 0x00007fd6bfa826d9 in thread_proxy () from ./lib/libboost_thread.so.1.64.0 #24 0x00007fd6bfeabdd5 in start_thread () from /lib64/libpthread.so.0 #25 0x00007fd6beb17ead in clone () from /lib64/libc.so.6 (gdb) (gdb) (gdb) f 9 #9 0x000000000069b836 in InformationCommand::Process (this=0x7ec8a38, task=..., response=@0x7fd58890f3f8: 0x0) at src/modules/DataCommand/InformationCommand.cpp:74 74 src/modules/DataCommand/InformationCommand.cpp: No such file or directory. (gdb) p task $1 = (const HDConstants::TaskDef &) @0x3b792f0: {data = 0x4537b60, socket = 0x3122000, clientAddr = 3748199939, clientPort = 33385, msgType = (unknown: 0), protocol = 2} (gdb) p task.data.size $2 = 71 (gdb) p serialNum $3 = 4623 (gdb) ``` ![Core源码位置](https://img-ask.csdn.net/upload/201912/05/1575510670_285044.png)
rpm源码安装中nss,nspr
rpm软件管理器源码安装所需要的配置文件有哪些,如nss,nspr。怎么安装,下载下来了 完全不知道怎么办
关于AT89C51单片机数字时钟的设计C语言程序warning问题
本人新手,还希望各位大大帮忙看下怎么解决 Build target 'Target 1' assembling STARTUP.A51... linking... *** WARNING L1: UNRESOLVED EXTERNAL SYMBOL SYMBOL: ?C_START MODULE: STARTUP.obj (?C_STARTUP) *** WARNING L2: REFERENCE MADE TO UNRESOLVED EXTERNAL SYMBOL: ?C_START MODULE: STARTUP.obj (?C_STARTUP) ADDRESS: 080AH Program Size: data=9.0 xdata=0 code=15 "t" - 0 Error(s), 2 Warning(s). 源程序如下: #include<reg52.h> #define uint unsigned int #define uchar unsigned char sbit QB1=P1^0; sbit QB2=P1^1; //数码管段选 sbit QB3=P1^2; sbit QB4=P1^3; sbit QB5=P1^4; sbit QB6=P1^5; sbit fm=P1^6; //蜂鸣器 sbit s1=P2^4; //s5按键,切换显示 sbit s2=P2^3; //s2按键,设置调时 sbit s3=P2^2; //s3按键,加1 sbit s4=P2^1; //s4按键,减1 sbit led1=P0^0; sbit led2=P0^1; sbit led3=P0^2; uchar count; uchar sec,minu,hour,day,week,mon; uchar n_sec,n_minu,n_hour; uint year; uchar set_2=1,set_1=1; uchar hs,hg,mis,mig,ss,sg; uchar nhs,nhg,nms,nmg,nss=0,nsg=0; uchar ms,mg,ds,dg,w; uchar code table[]={0XC0,0XF9,0XA4,0XB0,0X99,0X92,0X82,0XF8,0X80, 0X90,0X88,0X83,0XC6,0XA1,0X8E,0X86,0xbf}; //0~F,-,共阳 //uchar code tableyi[]={0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d, //0x07,0x7f,0x6f,0x77,0x7c,0x39,0x5e,0x79,0x71,0x40};//0-F,-,共阴 uchar code table_d[]={0xbf,0x86,0xdb,0xcf,0xe6,0xed,0xfd, 0x87,0xff,0xef}; //0~9数组,带小数点 uchar table1[]={31,31,29,31,30,31,30,31,31,30,31,30,31}; //闰年 uchar table2[]={31,31,28,31,30,31,30,31,31,30,31,30,31}; //非闰年 void delay(uint); //延时函数 void timer0(); //走时中断函数 void jishi(); //计时函数 void key_change(); //切换显示按键函数 void key_set(); //设置时间按键函数 void disp(uchar,uchar,uchar,uchar,uchar,uchar); //显示函数 void zd_clock(); //整点报时函数 void nz_clock(); //闹钟函数 uchar incone(uchar); //加1函数 uchar decone(uchar); //减1函数 void set_time(); //设置时间函数 void set_clock(); //设置闹钟函数 void set_mdw(); //设置月日星期函数 void main() //主函数 { EA=1; ET0=1; TR0=1; TMOD=0x01; TH0=0x4c; //50ms初值 晶振11.0592 TL0=0x00; hour=23;minu=59;sec=49; //赋初值:11点59分0秒 n_hour=12;n_minu=56;n_sec=0; //闹钟赋初值12点1分0秒 year=2008;mon=5;day=14;week=3;//年月日星期赋初值2008年5月11日星期天;祝天下所有母亲节日快乐 while(1) { hs=hour/10; //时分秒HH.MM.SS hg=hour%10; mis=minu/10; mig=minu%10; ss=sec/10; sg=sec%10; ms=mon/10; //月日-星期MM.DD.-W mg=mon%10; ds=day/10; dg=day%10; w=week; nhs=n_hour/10; //闹钟定时HH.MM.SS nhg=n_hour%10; nms=n_minu/10; nmg=n_minu%10; nss=n_sec/10; nsg=n_sec%10; key_change(); //s4按键扫描 key_set(); //s2按键扫描 set_time(); //设置时间 set_mdw(); //设置月日星期 set_clock(); //设置闹钟 if(set_1==1) //正常走时显示 { disp(hs,hg,mis,mig,ss,sg); } if(set_1==2) //设置时间,LED1闪亮 { disp(hs,hg,mis,mig,ss,sg); if(sec%2==0) {led2=1;led3=1;led1=~led1;} // else // {led1=1;} } if(set_1==3) //正常显示月日-星期 { disp(ms,mg,ds,dg,16,w); } if(set_1==4) //设置月日-星期,LED2闪亮 { disp(ms,mg,ds,dg,16,w); if(sec%2==0) {led1=1;led3=1;led2=~led2;} // else // {led2=1;} } if(set_1==5) //正常显示定时 { disp(nhs,nhg,nms,nmg,nss,nsg); } if(set_1==6) //设置闹钟定时,LED3闪亮 { disp(nhs,nhg,nms,nmg,nss,nsg); if(sec%2==0) {led1=1;led2=1;led3=~led3;} // else // {led3=1;} } zd_clock(); //整点报时 nz_clock(); //闹钟 } } void timer0() interrupt 1 //50ms中断函数 { TMOD=0x01; TH0=0x4c; //50ms初值 晶振11.0592 TL0=0x00; count++; if(count==20) { count=0; sec++; jishi(); //调计时函数 } } void jishi() //计时函数 { if(sec==60) { sec=0; minu++; if(minu==60) { minu=0; hour++; if(hour==24) { hour=0; day++; week++; if(week==8) {week=0;} if(year%4==0&&year%100!=0||year%400==0) //闰年 { if(day==table1[mon]+1) { day=0; mon++; if(mon==13) {mon=0;year++;} } } else //非闰年 { if(day==table2[mon]+1) { day=0; mon++; if(mon==13) {mon=0;year++;} } } } } } } void key_change() //s1按键扫描 { if(s1==0) { delay(200); if(s1==0) { set_1++; while(!s1); if(set_1==7) {set_1=1;} } } } void key_set() //s2按键扫描 { if(s2==0) { delay(10); if(s2==0) { set_2++; while(!s2); if(set_2==4) {set_2=1;} } } } void disp(uchar a1,uchar a2,uchar a3,uchar a4,uchar a5,uchar a6) //显示函数 { QB1=1; QB2=0; QB3=0; QB4=0; QB5=0; QB6=0; P3=table[a1]; //段码送P0口 delay(10); //延时一小会 QB1=0; QB2=1; QB3=0; QB4=0; QB5=0; QB6=0; P3=table[a2]; //第2个数码管显示,带小数点 delay(10); QB1=0; QB2=0; QB3=1; QB4=0; QB5=0; QB6=0; P3=table[a3]; //第3个数码管显示 delay(10); QB1=0; QB2=0; QB3=0; QB4=1; QB5=0; QB6=0; P3=table[a4]; //第4个数码管显示,带小数点 delay(10); QB1=0; QB2=0; QB3=0; QB4=0; QB5=1; QB6=0; //第5个数码管显示 P3=table[a5]; delay(10); QB1=0; QB2=0; QB3=0; QB4=0; QB5=0; QB6=1; P3=table[a6]; //第6个数码管显示 delay(10); QB1=0; QB2=0; QB3=0; QB4=0; QB5=0; QB6=0; } void zd_clock() //整点报时函数 { if(minu==59&&(sec==53||sec==55||sec==57)) { fm=0; delay(5); fm=1; delay(5); } fm=0; if(minu==59&&sec==59) { fm=0; delay(5); fm=1; delay(5); fm=0; } } void nz_clock() //闹钟函数 { if(hour==n_hour&&minu==n_minu&&sec==n_sec) //if((sec%2==0)&&sec<30) { fm=0; delay(1); fm=1; delay(1); } } void set_time() //设置时间函数 { if(set_1==2) { if(set_2==1) { hour=incone(hour); if(hour==24) {hour=0;} // if(hour<0) // {hour=23;} hour=decone(hour); } if(set_2==2) { minu=incone(minu); if(minu==60) {minu=0;} // if(minu<0) // {minu=59;} minu=decone(minu); } } } void set_mdw() //设置月日星期函数 { if(set_1==4) { if(set_2==1) { mon=incone(mon); if(mon==13) {mon=1;} mon=decone(mon); // if(mon==0) // {mon=12;} } if(set_2==2) { day=incone(day); if(day==32) {day=0;} day=decone(day); // if(day==0) // {day=0;} } if(set_2==3) { week=incone(week); if(week==8) {week=0;} week=decone(week); // if(week==0) // {week=7;} } } } void set_clock() //设置闹钟函数 { if(set_1==6) { if(set_2==1) { n_hour=incone(n_hour); if(n_hour==24) {n_hour=0;} n_hour=decone(n_hour); if(n_hour==0) {n_hour=0;} } if(set_2==2) { n_minu=incone(n_minu); if(n_minu==60) {n_minu=0;} n_minu=decone(n_minu); if(n_minu==0) {n_minu=0;} } } } uchar incone(uchar n) //加1函数 { if(s3==0) { delay(200); if(s3==0) { n++; while(!s3); } } return(n); } uchar decone(uchar m) //减1函数 { if(s4==0) { delay(200); if(s4==0) { m--; while(!s4); if(m<0) {m=0;} } } return(m); } void delay(uint k) //延时函数 { uint i,j; for(i=k;i>0;i--) for(j=80;j>0;j--); }
11AC的TX和RX差很大,高通的WiFi网卡
/root # iw wlan0_ap0 station dump Station e8:fc:af:a2:01:ab (on wlan0_ap0) inactive time: 0 ms rx bytes: 806698431 rx packets: 592207 tx bytes: 2763503886 tx packets: 1868211 tx retries: 0 tx failed: 0 signal: -44 dBm signal avg: -43 dBm tx bitrate: 6.0 MBit/s rx bitrate: 866.7 MBit/s VHT-MCS 9 80MHz short GI VHT-NSS 2 authorized: yes authenticated: yes preamble: long WMM/WME: yes MFP: no TDLS peer: no
Centos6.5 使用curl时 用valgrind 检查内存泄露
测试源码如下 ``` #include "stdio.h" #include <iostream> #include <curl/curl.h> #include <openssl/crypto.h> #include <openssl/err.h> #include <openssl/evp.h> #include <openssl/conf.h> #include <openssl/ssl.h> #include <openssl/rand.h> #define LOG_STD(p) std::cout<<__FUNCTION__<<" "<<p<<"["<<__FILE__<<":"<<__LINE__<<"]"<<std::endl int main(int argc, char* argv[]) { LOG_STD("test--begin"); CURLcode code = curl_global_init(CURL_GLOBAL_SSL); if (code != CURLE_OK) { LOG_STD("curl_global_init fail"); } LOG_STD("test--version:"<<curl_version()); sk_SSL_COMP_free(SSL_COMP_get_compression_methods()); CRYPTO_cleanup_all_ex_data(); CONF_modules_free(); ERR_remove_state(0); CONF_modules_unload(1); ERR_free_strings(); ERR_remove_thread_state(NULL); EVP_cleanup(); curl_global_cleanup(); LOG_STD("test--begin"); } ``` 直接测试结果如下 ``` [root@localhost curl_test]# valgrind --leak-check=full ./a.out ==4897== Memcheck, a memory error detector ==4897== Copyright (C) 2002-2015, and GNU GPL'd, by Julian Seward et al. ==4897== Using Valgrind-3.11.0 and LibVEX; rerun with -h for copyright info ==4897== Command: ./a.out ==4897== main test--begin[Test.cpp:18] main test--version:libcurl/7.19.7 NSS/3.21 Basic ECC zlib/1.2.3 libidn/1.18 libssh2/1.4.2[Test.cpp:25] main test--begin[Test.cpp:36] ==4897== ==4897== HEAP SUMMARY: ==4897== in use at exit: 7,776 bytes in 78 blocks ==4897== total heap usage: 88 allocs, 10 frees, 8,891 bytes allocated ==4897== ==4897== LEAK SUMMARY: ==4897== definitely lost: 0 bytes in 0 blocks ==4897== indirectly lost: 0 bytes in 0 blocks ==4897== possibly lost: 0 bytes in 0 blocks ==4897== still reachable: 7,776 bytes in 78 blocks ==4897== suppressed: 0 bytes in 0 blocks ==4897== Reachable blocks (those to which a pointer was found) are not shown. ==4897== To see them, rerun with: --leak-check=full --show-leak-kinds=all ==4897== ==4897== For counts of detected and suppressed errors, rerun with: -v ==4897== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 4 from 4) ``` 更新curl版本后测试如下 ``` [root@localhost curl_test]# valgrind --leak-check=full --show-leak-kinds=all ./a.out ==4979== Memcheck, a memory error detector ==4979== Copyright (C) 2002-2015, and GNU GPL'd, by Julian Seward et al. ==4979== Using Valgrind-3.11.0 and LibVEX; rerun with -h for copyright info ==4979== Command: ./a.out ==4979== main test--begin[Test.cpp:18] main test--version:libcurl/7.55.1 OpenSSL/1.0.1e zlib/1.2.3 c-ares/1.13.0 libssh2/1.8.0 nghttp2/1.6.0[Test.cpp:25] main test--begin[Test.cpp:36] ==4979== ==4979== HEAP SUMMARY: ==4979== in use at exit: 416 bytes in 6 blocks ==4979== total heap usage: 4,206 allocs, 4,200 frees, 142,966 bytes allocated ==4979== ==4979== 24 bytes in 1 blocks are still reachable in loss record 1 of 6 ==4979== at 0x4A0728A: malloc (vg_replace_malloc.c:299) ==4979== by 0x301566AC2D: CRYPTO_malloc (in /usr/lib64/libcrypto.so.1.0.1e) ==4979== by 0x301566C5E5: ??? (in /usr/lib64/libcrypto.so.1.0.1e) ==4979== by 0x301566C6A8: ??? (in /usr/lib64/libcrypto.so.1.0.1e) ==4979== by 0x30156D650F: engine_free_util (in /usr/lib64/libcrypto.so.1.0.1e) ==4979== by 0x30156D6B8F: ENGINE_remove (in /usr/lib64/libcrypto.so.1.0.1e) ==4979== by 0x30156D6C74: ??? (in /usr/lib64/libcrypto.so.1.0.1e) ==4979== by 0x30156D63B5: ??? (in /usr/lib64/libcrypto.so.1.0.1e) ==4979== by 0x30156E5A8F: sk_pop_free (in /usr/lib64/libcrypto.so.1.0.1e) ==4979== by 0x30156D638B: ENGINE_cleanup (in /usr/lib64/libcrypto.so.1.0.1e) ==4979== by 0x4C82CDD: ??? (in /usr/lib64/libcurl.so.4.4.0) ==4979== by 0x4C85D31: ??? (in /usr/lib64/libcurl.so.4.4.0) ==4979== ==4979== 24 bytes in 1 blocks are still reachable in loss record 2 of 6 ==4979== at 0x4A0728A: malloc (vg_replace_malloc.c:299) ==4979== by 0x301566AC2D: CRYPTO_malloc (in /usr/lib64/libcrypto.so.1.0.1e) ==4979== by 0x30156E6302: lh_insert (in /usr/lib64/libcrypto.so.1.0.1e) ==4979== by 0x301566C617: ??? (in /usr/lib64/libcrypto.so.1.0.1e) ==4979== by 0x301566C6A8: ??? (in /usr/lib64/libcrypto.so.1.0.1e) ==4979== by 0x30156D650F: engine_free_util (in /usr/lib64/libcrypto.so.1.0.1e) ==4979== by 0x30156D6B8F: ENGINE_remove (in /usr/lib64/libcrypto.so.1.0.1e) ==4979== by 0x30156D6C74: ??? (in /usr/lib64/libcrypto.so.1.0.1e) ==4979== by 0x30156D63B5: ??? (in /usr/lib64/libcrypto.so.1.0.1e) ==4979== by 0x30156E5A8F: sk_pop_free (in /usr/lib64/libcrypto.so.1.0.1e) ==4979== by 0x30156D638B: ENGINE_cleanup (in /usr/lib64/libcrypto.so.1.0.1e) ==4979== by 0x4C82CDD: ??? (in /usr/lib64/libcurl.so.4.4.0) ==4979== ==4979== 32 bytes in 1 blocks are still reachable in loss record 3 of 6 ==4979== at 0x4A0728A: malloc (vg_replace_malloc.c:299) ==4979== by 0x301566AC2D: CRYPTO_malloc (in /usr/lib64/libcrypto.so.1.0.1e) ==4979== by 0x30156E5C9E: sk_new (in /usr/lib64/libcrypto.so.1.0.1e) ==4979== by 0x301566C5FB: ??? (in /usr/lib64/libcrypto.so.1.0.1e) ==4979== by 0x301566C6A8: ??? (in /usr/lib64/libcrypto.so.1.0.1e) ==4979== by 0x30156D650F: engine_free_util (in /usr/lib64/libcrypto.so.1.0.1e) ==4979== by 0x30156D6B8F: ENGINE_remove (in /usr/lib64/libcrypto.so.1.0.1e) ==4979== by 0x30156D6C74: ??? (in /usr/lib64/libcrypto.so.1.0.1e) ==4979== by 0x30156D63B5: ??? (in /usr/lib64/libcrypto.so.1.0.1e) ==4979== by 0x30156E5A8F: sk_pop_free (in /usr/lib64/libcrypto.so.1.0.1e) ==4979== by 0x30156D638B: ENGINE_cleanup (in /usr/lib64/libcrypto.so.1.0.1e) ==4979== by 0x4C82CDD: ??? (in /usr/lib64/libcurl.so.4.4.0) ==4979== ==4979== 32 bytes in 1 blocks are still reachable in loss record 4 of 6 ==4979== at 0x4A0728A: malloc (vg_replace_malloc.c:299) ==4979== by 0x301566AC2D: CRYPTO_malloc (in /usr/lib64/libcrypto.so.1.0.1e) ==4979== by 0x30156E5CBC: sk_new (in /usr/lib64/libcrypto.so.1.0.1e) ==4979== by 0x301566C5FB: ??? (in /usr/lib64/libcrypto.so.1.0.1e) ==4979== by 0x301566C6A8: ??? (in /usr/lib64/libcrypto.so.1.0.1e) ==4979== by 0x30156D650F: engine_free_util (in /usr/lib64/libcrypto.so.1.0.1e) ==4979== by 0x30156D6B8F: ENGINE_remove (in /usr/lib64/libcrypto.so.1.0.1e) ==4979== by 0x30156D6C74: ??? (in /usr/lib64/libcrypto.so.1.0.1e) ==4979== by 0x30156D63B5: ??? (in /usr/lib64/libcrypto.so.1.0.1e) ==4979== by 0x30156E5A8F: sk_pop_free (in /usr/lib64/libcrypto.so.1.0.1e) ==4979== by 0x30156D638B: ENGINE_cleanup (in /usr/lib64/libcrypto.so.1.0.1e) ==4979== by 0x4C82CDD: ??? (in /usr/lib64/libcurl.so.4.4.0) ==4979== ==4979== 128 bytes in 1 blocks are still reachable in loss record 5 of 6 ==4979== at 0x4A0728A: malloc (vg_replace_malloc.c:299) ==4979== by 0x301566AC2D: CRYPTO_malloc (in /usr/lib64/libcrypto.so.1.0.1e) ==4979== by 0x30156E6391: lh_new (in /usr/lib64/libcrypto.so.1.0.1e) ==4979== by 0x301566C524: ??? (in /usr/lib64/libcrypto.so.1.0.1e) ==4979== by 0x301566C674: ??? (in /usr/lib64/libcrypto.so.1.0.1e) ==4979== by 0x301566C6A8: ??? (in /usr/lib64/libcrypto.so.1.0.1e) ==4979== by 0x30156D650F: engine_free_util (in /usr/lib64/libcrypto.so.1.0.1e) ==4979== by 0x30156D6B8F: ENGINE_remove (in /usr/lib64/libcrypto.so.1.0.1e) ==4979== by 0x30156D6C74: ??? (in /usr/lib64/libcrypto.so.1.0.1e) ==4979== by 0x30156D63B5: ??? (in /usr/lib64/libcrypto.so.1.0.1e) ==4979== by 0x30156E5A8F: sk_pop_free (in /usr/lib64/libcrypto.so.1.0.1e) ==4979== by 0x30156D638B: ENGINE_cleanup (in /usr/lib64/libcrypto.so.1.0.1e) ==4979== ==4979== 176 bytes in 1 blocks are still reachable in loss record 6 of 6 ==4979== at 0x4A0728A: malloc (vg_replace_malloc.c:299) ==4979== by 0x301566AC2D: CRYPTO_malloc (in /usr/lib64/libcrypto.so.1.0.1e) ==4979== by 0x30156E636F: lh_new (in /usr/lib64/libcrypto.so.1.0.1e) ==4979== by 0x301566C524: ??? (in /usr/lib64/libcrypto.so.1.0.1e) ==4979== by 0x301566C674: ??? (in /usr/lib64/libcrypto.so.1.0.1e) ==4979== by 0x301566C6A8: ??? (in /usr/lib64/libcrypto.so.1.0.1e) ==4979== by 0x30156D650F: engine_free_util (in /usr/lib64/libcrypto.so.1.0.1e) ==4979== by 0x30156D6B8F: ENGINE_remove (in /usr/lib64/libcrypto.so.1.0.1e) ==4979== by 0x30156D6C74: ??? (in /usr/lib64/libcrypto.so.1.0.1e) ==4979== by 0x30156D63B5: ??? (in /usr/lib64/libcrypto.so.1.0.1e) ==4979== by 0x30156E5A8F: sk_pop_free (in /usr/lib64/libcrypto.so.1.0.1e) ==4979== by 0x30156D638B: ENGINE_cleanup (in /usr/lib64/libcrypto.so.1.0.1e) ==4979== ==4979== LEAK SUMMARY: ==4979== definitely lost: 0 bytes in 0 blocks ==4979== indirectly lost: 0 bytes in 0 blocks ==4979== possibly lost: 0 bytes in 0 blocks ==4979== still reachable: 416 bytes in 6 blocks ==4979== suppressed: 0 bytes in 0 blocks ==4979== ==4979== For counts of detected and suppressed errors, rerun with: -v ==4979== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 4 from 4) ```
linux下tomcat开启后自动关闭
在linux下安装tomcat后启动后服务器没有响应,运行startup.sh后显示: Using CATALINA_BASE: /home/gavin/apache-tomcat Using CATALINA_HOME: /home/gavin/apache-tomcat Using CATALINA_TMPDIR: /home/gavin/apache-tomcat/temp Using JRE_HOME: /usr Using CLASSPATH: /home/gavin/apache-tomcat/bin/bootstrap.jar:/home/gavin/apache-tomcat/bin/tomcat-juli.jar Tomcat started. catalina.out显示内容如下: Jul 11, 2017 9:34:24 PM org.apache.catalina.startup.VersionLoggerListener log INFO: Server version: Apache Tomcat/7.0.79 Jul 11, 2017 9:34:24 PM org.apache.catalina.startup.VersionLoggerListener log INFO: Server built: Jun 26 2017 16:25:20 UTC Jul 11, 2017 9:34:24 PM org.apache.catalina.startup.VersionLoggerListener log INFO: Server number: 7.0.79.0 Jul 11, 2017 9:34:24 PM org.apache.catalina.startup.VersionLoggerListener log INFO: OS Name: Linux Jul 11, 2017 9:34:24 PM org.apache.catalina.startup.VersionLoggerListener log INFO: OS Version: 3.19.0-39-generic Jul 11, 2017 9:34:24 PM org.apache.catalina.startup.VersionLoggerListener log INFO: Architecture: amd64 Jul 11, 2017 9:34:24 PM org.apache.catalina.startup.VersionLoggerListener log INFO: Java Home: /usr/lib/jvm/java-7-openjdk-amd64/jre Jul 11, 2017 9:34:24 PM org.apache.catalina.startup.VersionLoggerListener log INFO: JVM Version: 1.7.0_121-b00 Jul 11, 2017 9:34:24 PM org.apache.catalina.startup.VersionLoggerListener log INFO: JVM Vendor: Oracle Corporation Jul 11, 2017 9:34:24 PM org.apache.catalina.startup.VersionLoggerListener log INFO: CATALINA_BASE: /home/gavin/apache-tomcat Jul 11, 2017 9:34:24 PM org.apache.catalina.startup.VersionLoggerListener log INFO: CATALINA_HOME: /home/gavin/apache-tomcat Jul 11, 2017 9:34:24 PM org.apache.catalina.startup.VersionLoggerListener log INFO: Command line argument: -Djava.util.logging.config.file=/home/gavin/apache-tomcat/conf/logging.properties Jul 11, 2017 9:34:24 PM org.apache.catalina.startup.VersionLoggerListener log INFO: Command line argument: -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager Jul 11, 2017 9:34:24 PM org.apache.catalina.startup.VersionLoggerListener log INFO: Command line argument: -Djdk.tls.ephemeralDHKeySize=2048 Jul 11, 2017 9:34:24 PM org.apache.catalina.startup.VersionLoggerListener log INFO: Command line argument: -Djava.endorsed.dirs=/home/gavin/apache-tomcat/endorsed Jul 11, 2017 9:34:24 PM org.apache.catalina.startup.VersionLoggerListener log INFO: Command line argument: -Dcatalina.base=/home/gavin/apache-tomcat Jul 11, 2017 9:34:24 PM org.apache.catalina.startup.VersionLoggerListener log INFO: Command line argument: -Dcatalina.home=/home/gavin/apache-tomcat Jul 11, 2017 9:34:24 PM org.apache.catalina.startup.VersionLoggerListener log INFO: Command line argument: -Djava.io.tmpdir=/home/gavin/apache-tomcat/temp Jul 11, 2017 9:34:24 PM org.apache.catalina.core.AprLifecycleListener lifecycleEvent INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: /usr/java/packages/lib/amd64:/usr/lib/x86_64-linux-gnu/jni:/lib/x86_64-linux-gnu:/usr/lib/x86_64-linux-gnu:/usr/lib/jni:/lib:/usr/lib Jul 11, 2017 9:34:24 PM org.apache.catalina.startup.Catalina load SEVERE: Catalina.start org.apache.catalina.LifecycleException: Failed to initialize component [StandardServer[8005]] at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:107) at org.apache.catalina.startup.Catalina.load(Catalina.java:643) at org.apache.catalina.startup.Catalina.load(Catalina.java:668) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:253) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:427) Caused by: java.security.ProviderException: Could not initialize NSS at sun.security.pkcs11.SunPKCS11.<init>(SunPKCS11.java:223) at sun.security.pkcs11.SunPKCS11.<init>(SunPKCS11.java:103) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:526) at sun.security.jca.ProviderConfig$2.run(ProviderConfig.java:224) at sun.security.jca.ProviderConfig$2.run(ProviderConfig.java:206) at java.security.AccessController.doPrivileged(Native Method) at sun.security.jca.ProviderConfig.doLoadProvider(ProviderConfig.java:206) at sun.security.jca.ProviderConfig.getProvider(ProviderConfig.java:187) at sun.security.jca.ProviderList.loadAll(ProviderList.java:282) at sun.security.jca.ProviderList.removeInvalid(ProviderList.java:299) at sun.security.jca.Providers.getFullProviderList(Providers.java:173) at java.security.Security.getProviders(Security.java:456) at org.apache.catalina.core.JreMemoryLeakPreventionListener.lifecycleEvent(JreMemoryLeakPreventionListener.java:437) at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117) at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90) at org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:388) at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:101) ... 8 more Caused by: java.io.IOException: NSS initialization failed at sun.security.pkcs11.Secmod.initialize(Secmod.java:223) at sun.security.pkcs11.SunPKCS11.<init>(SunPKCS11.java:218) ... 27 more Jul 11, 2017 9:34:24 PM org.apache.catalina.startup.Catalina load INFO: Initialization processed in 812 ms Jul 11, 2017 9:34:24 PM org.apache.catalina.core.StandardService startInternal INFO: Starting service Catalina Jul 11, 2017 9:34:24 PM org.apache.catalina.core.StandardEngine startInternal INFO: Starting Servlet Engine: Apache Tomcat/7.0.79 Jul 11, 2017 9:34:24 PM org.apache.catalina.startup.HostConfig deployDirectory INFO: Deploying web application directory /home/gavin/apache-tomcat/webapps/host-manager Jul 11, 2017 9:34:25 PM org.apache.catalina.startup.HostConfig deployDirectory INFO: Deployment of web application directory /home/gavin/apache-tomcat/webapps/host-manager has finished in 606 ms Jul 11, 2017 9:34:25 PM org.apache.catalina.startup.HostConfig deployDirectory INFO: Deploying web application directory /home/gavin/apache-tomcat/webapps/examples Jul 11, 2017 9:34:25 PM org.apache.catalina.startup.HostConfig deployDirectory INFO: Deployment of web application directory /home/gavin/apache-tomcat/webapps/examples has finished in 402 ms Jul 11, 2017 9:34:25 PM org.apache.catalina.startup.HostConfig deployDirectory INFO: Deploying web application directory /home/gavin/apache-tomcat/webapps/docs Jul 11, 2017 9:34:25 PM org.apache.catalina.startup.HostConfig deployDirectory INFO: Deployment of web application directory /home/gavin/apache-tomcat/webapps/docs has finished in 61 ms Jul 11, 2017 9:34:25 PM org.apache.catalina.startup.HostConfig deployDirectory INFO: Deploying web application directory /home/gavin/apache-tomcat/webapps/manager Jul 11, 2017 9:34:25 PM org.apache.catalina.startup.HostConfig deployDirectory INFO: Deployment of web application directory /home/gavin/apache-tomcat/webapps/manager has finished in 75 ms Jul 11, 2017 9:34:25 PM org.apache.catalina.startup.HostConfig deployDirectory INFO: Deploying web application directory /home/gavin/apache-tomcat/webapps/ROOT Jul 11, 2017 9:34:25 PM org.apache.catalina.startup.HostConfig deployDirectory INFO: Deployment of web application directory /home/gavin/apache-tomcat/webapps/ROOT has finished in 59 ms Jul 11, 2017 9:34:25 PM org.apache.coyote.AbstractProtocol init INFO: Initializing ProtocolHandler ["http-bio-8022"] Jul 11, 2017 9:34:25 PM org.apache.coyote.AbstractProtocol start INFO: Starting ProtocolHandler ["http-bio-8022"] Jul 11, 2017 9:34:25 PM org.apache.coyote.AbstractProtocol init INFO: Initializing ProtocolHandler ["ajp-bio-8009"] Jul 11, 2017 9:34:25 PM org.apache.coyote.AbstractProtocol start INFO: Starting ProtocolHandler ["ajp-bio-8009"] Jul 11, 2017 9:34:25 PM org.apache.catalina.startup.Catalina start INFO: Server startup in 1318 ms Jul 11, 2017 9:34:25 PM org.apache.coyote.AbstractProtocol pause INFO: Pausing ProtocolHandler ["http-bio-8022"] Jul 11, 2017 9:34:25 PM org.apache.coyote.AbstractProtocol pause INFO: Pausing ProtocolHandler ["ajp-bio-8009"] Jul 11, 2017 9:34:25 PM org.apache.catalina.core.StandardService stopInternal INFO: Stopping service Catalina Jul 11, 2017 9:34:25 PM org.apache.coyote.AbstractProtocol stop INFO: Stopping ProtocolHandler ["http-bio-8022"] Jul 11, 2017 9:34:25 PM org.apache.coyote.AbstractProtocol stop INFO: Stopping ProtocolHandler ["ajp-bio-8009"] Jul 11, 2017 9:34:25 PM org.apache.coyote.AbstractProtocol destroy INFO: Destroying ProtocolHandler ["http-bio-8022"] Jul 11, 2017 9:34:25 PM org.apache.coyote.AbstractProtocol destroy INFO: Destroying ProtocolHandler ["ajp-bio-8009"]
相见恨晚的超实用网站
搞学习 知乎:www.zhihu.com 简答题:http://www.jiandati.com/ 网易公开课:https://open.163.com/ted/ 网易云课堂:https://study.163.com/ 中国大学MOOC:www.icourse163.org 网易云课堂:study.163.com 哔哩哔哩弹幕网:www.bilibili.com 我要自学网:www.51zxw
花了20分钟,给女朋友们写了一个web版群聊程序
参考博客 [1]https://www.byteslounge.com/tutorials/java-ee-html5-websocket-example
爬虫福利二 之 妹子图网MM批量下载
爬虫福利一:27报网MM批量下载    点击 看了本文,相信大家对爬虫一定会产生强烈的兴趣,激励自己去学习爬虫,在这里提前祝:大家学有所成! 目标网站:妹子图网 环境:Python3.x 相关第三方模块:requests、beautifulsoup4 Re:各位在测试时只需要将代码里的变量 path 指定为你当前系统要保存的路径,使用 python xxx.py 或IDE运行即可。
字节跳动视频编解码面经
引言 本文主要是记录一下面试字节跳动的经历。 三四月份投了字节跳动的实习(图形图像岗位),然后hr打电话过来问了一下会不会opengl,c++,shador,当时只会一点c++,其他两个都不会,也就直接被拒了。 七月初内推了字节跳动的提前批,因为内推没有具体的岗位,hr又打电话问要不要考虑一下图形图像岗,我说实习投过这个岗位不合适,不会opengl和shador,然后hr就说秋招更看重基础。我当时
Java学习的正确打开方式
在博主认为,对于入门级学习java的最佳学习方法莫过于视频+博客+书籍+总结,前三者博主将淋漓尽致地挥毫于这篇博客文章中,至于总结在于个人,实际上越到后面你会发现学习的最好方式就是阅读参考官方文档其次就是国内的书籍,博客次之,这又是一个层次了,这里暂时不提后面再谈。博主将为各位入门java保驾护航,各位只管冲鸭!!!上天是公平的,只要不辜负时间,时间自然不会辜负你。 何谓学习?博主所理解的学习,它
程序员必须掌握的核心算法有哪些?
由于我之前一直强调数据结构以及算法学习的重要性,所以就有一些读者经常问我,数据结构与算法应该要学习到哪个程度呢?,说实话,这个问题我不知道要怎么回答你,主要取决于你想学习到哪些程度,不过针对这个问题,我稍微总结一下我学过的算法知识点,以及我觉得值得学习的算法。这些算法与数据结构的学习大多数是零散的,并没有一本把他们全部覆盖的书籍。下面是我觉得值得学习的一些算法以及数据结构,当然,我也会整理一些看过
大学四年自学走来,这些私藏的实用工具/学习网站我贡献出来了
大学四年,看课本是不可能一直看课本的了,对于学习,特别是自学,善于搜索网上的一些资源来辅助,还是非常有必要的,下面我就把这几年私藏的各种资源,网站贡献出来给你们。主要有:电子书搜索、实用工具、在线视频学习网站、非视频学习网站、软件下载、面试/求职必备网站。 注意:文中提到的所有资源,文末我都给你整理好了,你们只管拿去,如果觉得不错,转发、分享就是最大的支持了。 一、电子书搜索 对于大部分程序员...
linux系列之常用运维命令整理笔录
本博客记录工作中需要的linux运维命令,大学时候开始接触linux,会一些基本操作,可是都没有整理起来,加上是做开发,不做运维,有些命令忘记了,所以现在整理成博客,当然vi,文件操作等就不介绍了,慢慢积累一些其它拓展的命令,博客不定时更新 顺便拉下票,我在参加csdn博客之星竞选,欢迎投票支持,每个QQ或者微信每天都可以投5票,扫二维码即可,http://m234140.nofollow.ax.
比特币原理详解
一、什么是比特币 比特币是一种电子货币,是一种基于密码学的货币,在2008年11月1日由中本聪发表比特币白皮书,文中提出了一种去中心化的电子记账系统,我们平时的电子现金是银行来记账,因为银行的背后是国家信用。去中心化电子记账系统是参与者共同记账。比特币可以防止主权危机、信用风险。其好处不多做赘述,这一层面介绍的文章很多,本文主要从更深层的技术原理角度进行介绍。 二、问题引入 假设现有4个人...
Python 基础(一):入门必备知识
目录1 标识符2 关键字3 引号4 编码5 输入输出6 缩进7 多行8 注释9 数据类型10 运算符10.1 常用运算符10.2 运算符优先级 1 标识符 标识符是编程时使用的名字,用于给变量、函数、语句块等命名,Python 中标识符由字母、数字、下划线组成,不能以数字开头,区分大小写。 以下划线开头的标识符有特殊含义,单下划线开头的标识符,如:_xxx ,表示不能直接访问的类属性,需通过类提供
这30个CSS选择器,你必须熟记(上)
关注前端达人,与你共同进步CSS的魅力就是让我们前端工程师像设计师一样进行网页的设计,我们能轻而易举的改变颜色、布局、制作出漂亮的影音效果等等,我们只需要改几行代码,不需...
国产开源API网关项目进入Apache孵化器:APISIX
点击蓝色“程序猿DD”关注我回复“资源”获取独家整理的学习资料!近日,又有一个开源项目加入了这个Java开源界大名鼎鼎的Apache基金会,开始进行孵化器。项目名称:AP...
程序员接私活怎样防止做完了不给钱?
首先跟大家说明一点,我们做 IT 类的外包开发,是非标品开发,所以很有可能在开发过程中会有这样那样的需求修改,而这种需求修改很容易造成扯皮,进而影响到费用支付,甚至出现做完了项目收不到钱的情况。 那么,怎么保证自己的薪酬安全呢? 我们在开工前,一定要做好一些证据方面的准备(也就是“讨薪”的理论依据),这其中最重要的就是需求文档和验收标准。一定要让需求方提供这两个文档资料作为开发的基础。之后开发
网页实现一个简单的音乐播放器(大佬别看。(⊙﹏⊙))
今天闲着无事,就想写点东西。然后听了下歌,就打算写个播放器。 于是乎用h5 audio的加上js简单的播放器完工了。 欢迎 改进 留言。 演示地点跳到演示地点 html代码如下`&lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head&gt; &lt;title&gt;music&lt;/title&gt; &lt;meta charset="utf-8"&gt
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)杨辉三角
杨辉三角 是经典算法,这篇博客对它的算法思想进行了讲解,并有完整的代码实现。
编写Spring MVC控制器的14个技巧
本期目录 1.使用@Controller构造型 2.实现控制器接口 3.扩展AbstractController类 4.为处理程序方法指定URL映射 5.为处理程序方法指定HTTP请求方法 6.将请求参数映射到处理程序方法 7.返回模型和视图 8.将对象放入模型 9.处理程序方法中的重定向 10.处理表格提交和表格验证 11.处理文件上传 12.在控制器中自动装配业务类 ...
腾讯算法面试题:64匹马8个跑道需要多少轮才能选出最快的四匹?
昨天,有网友私信我,说去阿里面试,彻底的被打击到了。问了为什么网上大量使用ThreadLocal的源码都会加上private static?他被难住了,因为他从来都没有考虑过这个问题。无独有偶,今天笔者又发现有网友吐槽了一道腾讯的面试题,我们一起来看看。 腾讯算法面试题:64匹马8个跑道需要多少轮才能选出最快的四匹? 在互联网职场论坛,一名程序员发帖求助到。二面腾讯,其中一个算法题:64匹
面试官:你连RESTful都不知道我怎么敢要你?
面试官:了解RESTful吗? 我:听说过。 面试官:那什么是RESTful? 我:就是用起来很规范,挺好的 面试官:是RESTful挺好的,还是自我感觉挺好的 我:都挺好的。 面试官:… 把门关上。 我:… 要干嘛?先关上再说。 面试官:我说出去把门关上。 我:what ?,夺门而去 文章目录01 前言02 RESTful的来源03 RESTful6大原则1. C-S架构2. 无状态3.统一的接
求小姐姐抠图竟遭白眼?痛定思痛,我决定用 Python 自力更生!
点击蓝色“Python空间”关注我丫加个“星标”,每天一起快乐的学习大家好,我是 Rocky0429,一个刚恰完午饭,正在用刷网页浪费生命的蒟蒻...一堆堆无聊八卦信息的网页内容慢慢使我的双眼模糊,一个哈欠打出了三斤老泪,就在此时我看到了一张图片:是谁!是谁把我女朋友的照片放出来的!awsl!太好看了叭...等等,那个背景上的一堆鬼画符是什么鬼?!真是看不下去!叔叔婶婶能忍,隔壁老王的三姨妈的四表...
为啥国人偏爱Mybatis,而老外喜欢Hibernate/JPA呢?
关于SQL和ORM的争论,永远都不会终止,我也一直在思考这个问题。昨天又跟群里的小伙伴进行了一番讨论,感触还是有一些,于是就有了今天这篇文。 声明:本文不会下关于Mybatis和JPA两个持久层框架哪个更好这样的结论。只是摆事实,讲道理,所以,请各位看官勿喷。 一、事件起因 关于Mybatis和JPA孰优孰劣的问题,争论已经很多年了。一直也没有结论,毕竟每个人的喜好和习惯是大不相同的。我也看
SQL-小白最佳入门sql查询一
不要偷偷的查询我的个人资料,即使你再喜欢我,也不要这样,真的不好;
项目中的if else太多了,该怎么重构?
介绍 最近跟着公司的大佬开发了一款IM系统,类似QQ和微信哈,就是聊天软件。我们有一部分业务逻辑是这样的 if (msgType = "文本") { // dosomething } else if(msgType = "图片") { // doshomething } else if(msgType = "视频") { // doshomething } else { // doshom...
致 Python 初学者
欢迎来到“Python进阶”专栏!来到这里的每一位同学,应该大致上学习了很多 Python 的基础知识,正在努力成长的过程中。在此期间,一定遇到了很多的困惑,对未来的学习方向感到迷茫。我非常理解你们所面临的处境。我从2007年开始接触 python 这门编程语言,从2009年开始单一使用 python 应对所有的开发工作,直至今天。回顾自己的学习过程,也曾经遇到过无数的困难,也曾经迷茫过、困惑过。开办这个专栏,正是为了帮助像我当年一样困惑的 Python 初学者走出困境、快速成长。希望我的经验能真正帮到你
“狗屁不通文章生成器”登顶GitHub热榜,分分钟写出万字形式主义大作
一、垃圾文字生成器介绍 最近在浏览GitHub的时候,发现了这样一个骨骼清奇的雷人项目,而且热度还特别高。 项目中文名:狗屁不通文章生成器 项目英文名:BullshitGenerator 根据作者的介绍,他是偶尔需要一些中文文字用于GUI开发时测试文本渲染,因此开发了这个废话生成器。但由于生成的废话实在是太过富于哲理,所以最近已经被小伙伴们给玩坏了。 他的文风可能是这样的: 你发现,...
程序员:我终于知道post和get的区别
是一个老生常谈的话题,然而随着不断的学习,对于以前的认识有很多误区,所以还是需要不断地总结的,学而时习之,不亦说乎
《程序人生》系列-这个程序员只用了20行代码就拿了冠军
你知道的越多,你不知道的越多 点赞再看,养成习惯GitHub上已经开源https://github.com/JavaFamily,有一线大厂面试点脑图,欢迎Star和完善 前言 这一期不算《吊打面试官》系列的,所有没前言我直接开始。 絮叨 本来应该是没有这期的,看过我上期的小伙伴应该是知道的嘛,双十一比较忙嘛,要值班又要去帮忙拍摄年会的视频素材,还得搞个程序员一天的Vlog,还要写BU...
加快推动区块链技术和产业创新发展,2019可信区块链峰会在京召开
11月8日,由中国信息通信研究院、中国通信标准化协会、中国互联网协会、可信区块链推进计划联合主办,科技行者协办的2019可信区块链峰会将在北京悠唐皇冠假日酒店开幕。   区块链技术被认为是继蒸汽机、电力、互联网之后,下一代颠覆性的核心技术。如果说蒸汽机释放了人类的生产力,电力解决了人类基本的生活需求,互联网彻底改变了信息传递的方式,区块链作为构造信任的技术有重要的价值。   1...
程序员把地府后台管理系统做出来了,还有3.0版本!12月7号最新消息:已在开发中有github地址
第一幕:缘起 听说阎王爷要做个生死簿后台管理系统,我们派去了一个程序员…… 996程序员做的梦: 第一场:团队招募 为了应对地府管理危机,阎王打算找“人”开发一套地府后台管理系统,于是就在地府总经办群中发了项目需求。 话说还是中国电信的信号好,地府都是满格,哈哈!!! 经常会有外行朋友问:看某网站做的不错,功能也简单,你帮忙做一下? 而这次,面对这样的需求,这个程序员...
网易云6亿用户音乐推荐算法
网易云音乐是音乐爱好者的集聚地,云音乐推荐系统致力于通过 AI 算法的落地,实现用户千人千面的个性化推荐,为用户带来不一样的听歌体验。 本次分享重点介绍 AI 算法在音乐推荐中的应用实践,以及在算法落地过程中遇到的挑战和解决方案。 将从如下两个部分展开: AI算法在音乐推荐中的应用 音乐场景下的 AI 思考 从 2013 年 4 月正式上线至今,网易云音乐平台持续提供着:乐屏社区、UGC...
相关热词 c# 图片上传 c# gdi 占用内存 c#中遍历字典 c#控制台模拟dos c# 斜率 最小二乘法 c#进程延迟 c# mysql完整项目 c# grid 总行数 c# web浏览器插件 c# xml 生成xsd
立即提问