B
BIDOU
Guest
Здравствуйте,
.
Я сделал эту функцию, может быть, быстрее, но я не знаю, если это возможно, чтобы оптимизировать его.Потому что это занимает много данных, программа памяти ...(например, 200 байт).
Это для PIC16Fxxx ...
Я думаю, это основная форма для этой функции.Использование этой функции, как vAffichage ('7 ');Код:# включить <pic.h># DEFINE SEGMENT_A RB0
# DEFINE SEGMENT_B RB1
# DEFINE SEGMENT_C RB2
# DEFINE SEGMENT_D RB3
# DEFINE SEGMENT_E RB4
# DEFINE SEGMENT_F RB5
# DEFINE SEGMENT_G RB6# определим на 1
# DEFINE OFF 0Пустота vAffichage (неподписанных ucCharacter Char)
(
переключателя (ucCharacter)
(
случае '0 ':
дело 'O':
SEGMENT_A = On;
SEGMENT_B = On;
SEGMENT_C = On;
SEGMENT_D = On;
SEGMENT_E = On;
SEGMENT_F = On;
SEGMENT_G = Off;
брейк;
случае '1 ':
дело 'L':
SEGMENT_A = Off;
SEGMENT_B = On;
SEGMENT_C = On;
SEGMENT_D = Off;
SEGMENT_E = Off;
SEGMENT_F = Off;
SEGMENT_G = Off;
брейк;
случае '2 ':
SEGMENT_A = On;
SEGMENT_B = On;
SEGMENT_C = Off;
SEGMENT_D = On;
SEGMENT_E = On;
SEGMENT_F = Off;
SEGMENT_G = On;
брейк;
случае '3 ':
SEGMENT_A = On;
SEGMENT_B = On;
SEGMENT_C = On;
SEGMENT_D = On;
SEGMENT_E = Off;
SEGMENT_F = Off;
SEGMENT_G = On;
брейк;
случае '4 ':
SEGMENT_A = Off;
SEGMENT_B = On;
SEGMENT_C = On;
SEGMENT_D = Off;
SEGMENT_E = Off;
SEGMENT_F = On;
SEGMENT_G = On;
брейк;
случае '5 ':
дело 'S':
SEGMENT_A = On;
SEGMENT_B = Off;
SEGMENT_C = On;
SEGMENT_D = On;
SEGMENT_E = Off;
SEGMENT_F = On;
SEGMENT_G = On;
брейк;
случае '6 ':
SEGMENT_A = On;
SEGMENT_B = Off;
SEGMENT_C = On;
SEGMENT_D = On;
SEGMENT_E = On;
SEGMENT_F = On;
SEGMENT_G = On;
брейк;
случае '7 ':
SEGMENT_A = On;
SEGMENT_B = On;
SEGMENT_C = On;
SEGMENT_D = Off;
SEGMENT_E = Off;
SEGMENT_F = Off;
SEGMENT_G = Off;
брейк;
случае '8 ':
SEGMENT_A = On;
SEGMENT_B = On;
SEGMENT_C = On;
SEGMENT_D = On;
SEGMENT_E = On;
SEGMENT_F = On;
SEGMENT_G = On;
брейк;
случае '9 ':
SEGMENT_A = On;
SEGMENT_B = On;
SEGMENT_C = On;
SEGMENT_D = Off;
SEGMENT_E = Off;
SEGMENT_F = On;
SEGMENT_G = On;
брейк;
дело 'D':
SEGMENT_A = Off;
SEGMENT_B = On;
SEGMENT_C = On;
SEGMENT_D = On;
SEGMENT_E = On;
SEGMENT_F = Off;
SEGMENT_G = On;
брейк;
дело 'O':
SEGMENT_A = Off;
SEGMENT_B = Off;
SEGMENT_C = On;
SEGMENT_D = On;
SEGMENT_E = On;
SEGMENT_F = Off;
SEGMENT_G = On;
брейк;
дело 'A':
SEGMENT_A = On;
SEGMENT_B = On;
SEGMENT_C = On;
SEGMENT_D = Off;
SEGMENT_E = On;
SEGMENT_F = On;
SEGMENT_G = On;
брейк;
дело 'C':
SEGMENT_A = On;
SEGMENT_B = Off;
SEGMENT_C = Off;
SEGMENT_D = On;
SEGMENT_E = On;
SEGMENT_F = On;
SEGMENT_G = Off;
брейк;
дело 'F':
SEGMENT_A = On;
SEGMENT_B = Off;
SEGMENT_C = Off;
SEGMENT_D = Off;
SEGMENT_E = On;
SEGMENT_F = On;
SEGMENT_G = On;
брейк;
дело 'H':
SEGMENT_A = Off;
SEGMENT_B = On;
SEGMENT_C = On;
SEGMENT_D = Off;
SEGMENT_E = On;
SEGMENT_F = On;
SEGMENT_G = On;
брейк;
дело 'L':
SEGMENT_A = Off;
SEGMENT_B = Off;
SEGMENT_C = Off;
SEGMENT_D = On;
SEGMENT_E = On;
SEGMENT_F = On;
SEGMENT_G = Off;
брейк;
дело 'P':
SEGMENT_A = On;
SEGMENT_B = On;
SEGMENT_C = Off;
SEGMENT_D = Off;
SEGMENT_E = On;
SEGMENT_F = On;
SEGMENT_G = On;
брейк;
дело '_':
SEGMENT_A = Off;
SEGMENT_B = Off;
SEGMENT_C = Off;
SEGMENT_D = On;
SEGMENT_E = Off;
SEGMENT_F = Off;
SEGMENT_G = Off;
брейк;
) / / Fin переключатель (ucCharacter).)
.
Я сделал эту функцию, может быть, быстрее, но я не знаю, если это возможно, чтобы оптимизировать его.Потому что это занимает много данных, программа памяти ...(например, 200 байт).
Это для PIC16Fxxx ...
Я думаю, это основная форма для этой функции.Использование этой функции, как vAffichage ('7 ');Код:# включить <pic.h># DEFINE SEGMENT_A RB0
# DEFINE SEGMENT_B RB1
# DEFINE SEGMENT_C RB2
# DEFINE SEGMENT_D RB3
# DEFINE SEGMENT_E RB4
# DEFINE SEGMENT_F RB5
# DEFINE SEGMENT_G RB6# определим на 1
# DEFINE OFF 0Пустота vAffichage (неподписанных ucCharacter Char)
(
переключателя (ucCharacter)
(
случае '0 ':
дело 'O':
SEGMENT_A = On;
SEGMENT_B = On;
SEGMENT_C = On;
SEGMENT_D = On;
SEGMENT_E = On;
SEGMENT_F = On;
SEGMENT_G = Off;
брейк;
случае '1 ':
дело 'L':
SEGMENT_A = Off;
SEGMENT_B = On;
SEGMENT_C = On;
SEGMENT_D = Off;
SEGMENT_E = Off;
SEGMENT_F = Off;
SEGMENT_G = Off;
брейк;
случае '2 ':
SEGMENT_A = On;
SEGMENT_B = On;
SEGMENT_C = Off;
SEGMENT_D = On;
SEGMENT_E = On;
SEGMENT_F = Off;
SEGMENT_G = On;
брейк;
случае '3 ':
SEGMENT_A = On;
SEGMENT_B = On;
SEGMENT_C = On;
SEGMENT_D = On;
SEGMENT_E = Off;
SEGMENT_F = Off;
SEGMENT_G = On;
брейк;
случае '4 ':
SEGMENT_A = Off;
SEGMENT_B = On;
SEGMENT_C = On;
SEGMENT_D = Off;
SEGMENT_E = Off;
SEGMENT_F = On;
SEGMENT_G = On;
брейк;
случае '5 ':
дело 'S':
SEGMENT_A = On;
SEGMENT_B = Off;
SEGMENT_C = On;
SEGMENT_D = On;
SEGMENT_E = Off;
SEGMENT_F = On;
SEGMENT_G = On;
брейк;
случае '6 ':
SEGMENT_A = On;
SEGMENT_B = Off;
SEGMENT_C = On;
SEGMENT_D = On;
SEGMENT_E = On;
SEGMENT_F = On;
SEGMENT_G = On;
брейк;
случае '7 ':
SEGMENT_A = On;
SEGMENT_B = On;
SEGMENT_C = On;
SEGMENT_D = Off;
SEGMENT_E = Off;
SEGMENT_F = Off;
SEGMENT_G = Off;
брейк;
случае '8 ':
SEGMENT_A = On;
SEGMENT_B = On;
SEGMENT_C = On;
SEGMENT_D = On;
SEGMENT_E = On;
SEGMENT_F = On;
SEGMENT_G = On;
брейк;
случае '9 ':
SEGMENT_A = On;
SEGMENT_B = On;
SEGMENT_C = On;
SEGMENT_D = Off;
SEGMENT_E = Off;
SEGMENT_F = On;
SEGMENT_G = On;
брейк;
дело 'D':
SEGMENT_A = Off;
SEGMENT_B = On;
SEGMENT_C = On;
SEGMENT_D = On;
SEGMENT_E = On;
SEGMENT_F = Off;
SEGMENT_G = On;
брейк;
дело 'O':
SEGMENT_A = Off;
SEGMENT_B = Off;
SEGMENT_C = On;
SEGMENT_D = On;
SEGMENT_E = On;
SEGMENT_F = Off;
SEGMENT_G = On;
брейк;
дело 'A':
SEGMENT_A = On;
SEGMENT_B = On;
SEGMENT_C = On;
SEGMENT_D = Off;
SEGMENT_E = On;
SEGMENT_F = On;
SEGMENT_G = On;
брейк;
дело 'C':
SEGMENT_A = On;
SEGMENT_B = Off;
SEGMENT_C = Off;
SEGMENT_D = On;
SEGMENT_E = On;
SEGMENT_F = On;
SEGMENT_G = Off;
брейк;
дело 'F':
SEGMENT_A = On;
SEGMENT_B = Off;
SEGMENT_C = Off;
SEGMENT_D = Off;
SEGMENT_E = On;
SEGMENT_F = On;
SEGMENT_G = On;
брейк;
дело 'H':
SEGMENT_A = Off;
SEGMENT_B = On;
SEGMENT_C = On;
SEGMENT_D = Off;
SEGMENT_E = On;
SEGMENT_F = On;
SEGMENT_G = On;
брейк;
дело 'L':
SEGMENT_A = Off;
SEGMENT_B = Off;
SEGMENT_C = Off;
SEGMENT_D = On;
SEGMENT_E = On;
SEGMENT_F = On;
SEGMENT_G = Off;
брейк;
дело 'P':
SEGMENT_A = On;
SEGMENT_B = On;
SEGMENT_C = Off;
SEGMENT_D = Off;
SEGMENT_E = On;
SEGMENT_F = On;
SEGMENT_G = On;
брейк;
дело '_':
SEGMENT_A = Off;
SEGMENT_B = Off;
SEGMENT_C = Off;
SEGMENT_D = On;
SEGMENT_E = Off;
SEGMENT_F = Off;
SEGMENT_G = Off;
брейк;
) / / Fin переключатель (ucCharacter).)