STMicroelectronics STM8 Manual page 78

Table of Contents

Advertisement

stm8s_it.h (top part only)
#ifndef __STM8S_IT_H
#define __STM8S_IT_H
@far @interrupt void TIM4_UPD_IRQHandler(void);
/* Includes ------------------------------------------------------------------*/
#include "stm8s.h"
stm8s_it.c (top part only)
#include "stm8s.h"
#include "stm8s_it.h"
extern unsigned int value;
extern unsigned char n;
extern unsigned char seg;
extern const unsigned char num[10];
void TIM4_UPD_IRQHandler(void)
{
switch(seg)
{
case 1:
{
}
case 2:
{
}
case 3:
{
}
case 4:
{
}
}
seg++;
if(seg > 4)
n = (value / 1000);
GPIO_Write(GPIOD, num[n]);
GPIO_Write(GPIOC, 0xE0);
break;
n = ((value / 100) % 10);
GPIO_Write(GPIOD, num[n]);
GPIO_Write(GPIOC, 0xD0);
break;
n = ((value / 10) % 10);
GPIO_Write(GPIOD, num[n]);
GPIO_Write(GPIOC, 0xB0);
break;
n = (value % 10);
GPIO_Write(GPIOD, num[n]);
GPIO_Write(GPIOC, 0x70);
break;

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the STM8 and is the answer not in the manual?

Questions and answers

Subscribe to Our Youtube Channel

Table of Contents

Save PDF