-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpulls.c
35 lines (25 loc) · 774 Bytes
/
pulls.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#include <xc.h> /* XC8 General Include File */
#include <stdbool.h> /* Bools, true of false */
#include <stdint.h> /* For uint8_t definition */
#include <stdlib.h>
#include <pic16f877a.h>
#include "debug_leds.h"
#include "pulls.h"
#include "timers.h"
#include "uart.h"
extern volatile uint8_t theVariableThatTheIsrChanges;
void pull_low_kline(uint8_t time)
{
/* We need to disable the uart peripheral in order to pull tx up or down! */
disable_async_port_uart();
PORTCbits.RC6 = 0;
delay(time);
while (!theVariableThatTheIsrChanges);
PORTCbits.RC6 = 1;
}
void pull_up_terrain_kline(uint8_t time)
{
disable_async_port_uart()
PORTCbits.RC6 = 1;
delay(time);
}