Пн фев 05, 2018 12:45:04
Пн фев 05, 2018 21:00:47
Пн фев 05, 2018 21:53:19
Пн фев 12, 2018 22:48:55
Пн фев 12, 2018 23:44:30
Вт фев 13, 2018 12:50:50
Вт фев 13, 2018 13:30:45
Вт фев 13, 2018 14:06:46
Вт фев 13, 2018 18:23:11
Вт фев 13, 2018 18:26:48
Вт фев 13, 2018 20:28:17
Вт фев 13, 2018 22:51:26
Чт фев 15, 2018 10:51:04
if (GPIO_ReadInputDataBit(GPIOA, GPIO_Pin_0) == 1)
{
if(Button_count<5) Button_count++;
else Button_state=1;
}
else
{
if (Button_count>0)Button_count--;
else Button_state=0;
Чт фев 15, 2018 11:02:14
Чт фев 15, 2018 13:27:20
изучение тут самоцель.
while(1)
{
if (GPIO_ReadInputDataBit(GPIOA, GPIO_Pin_0) == 1)
{
if(Button_count<200) Button_count++; //устранение дребезга
else Button_state=1;
}
else
{
if (Button_count>0)Button_count--;
else Button_state=0;
}
//temp++;
if(Button_state==1)
{
Mode++;
if(Mode==1) //режимы
{
GPIO_SetBits(GPIOE, GPIO_Pin_8);
GPIO_ResetBits(GPIOE, GPIO_Pin_10);
}
if(Mode==2)
{
GPIO_SetBits(GPIOE, GPIO_Pin_9);
GPIO_ResetBits(GPIOE, GPIO_Pin_8);
}
if(Mode==3)
{
GPIO_SetBits(GPIOE, GPIO_Pin_10);
GPIO_ResetBits(GPIOE, GPIO_Pin_9);
}
if (Mode>3)Mode=0;
}
}
}
Чт фев 15, 2018 13:34:42
Чт фев 15, 2018 13:58:50
Чт фев 15, 2018 22:26:43
int ADS1248_RegWrite(uint8_t reg,uint8_t *data,uint8_t count)
{
//uint8_t *txbuf;
uint8_t txbuf[16];
int ret;
//txbuf = malloc(sizeof(uint8_t) * (2 + count));
/*if(txbuf == NULL) {
return -1;
}*/
txbuf[0] = ADS1248_COM_WREG | reg;
if(count > 0)
txbuf[1] = count-1;
else
txbuf[1] = 0;
memcpy(&txbuf[2],data,count);
ret = ADS1248_WriteRead(txbuf,2 + count,NULL,0);
//free(txbuf);
return ret;
}
Пт фев 16, 2018 01:58:17
Пт фев 16, 2018 04:28:06