move begin time
This commit is contained in:
@ -19,6 +19,9 @@ void handle_sigint(int sig) {
|
|||||||
int main() {
|
int main() {
|
||||||
signal(SIGINT, handle_sigint);
|
signal(SIGINT, handle_sigint);
|
||||||
|
|
||||||
|
struct timeval start_time;
|
||||||
|
gettimeofday(&start_time, NULL);
|
||||||
|
|
||||||
const char* device = "/dev/spidev1.0";
|
const char* device = "/dev/spidev1.0";
|
||||||
const uint8_t spi_mode = SPI_MODE_0;
|
const uint8_t spi_mode = SPI_MODE_0;
|
||||||
const uint8_t spi_bits = 8;
|
const uint8_t spi_bits = 8;
|
||||||
@ -34,9 +37,6 @@ int main() {
|
|||||||
uint8_t* buffer = malloc(data_size);
|
uint8_t* buffer = malloc(data_size);
|
||||||
Color* colors = malloc(sizeof(Color) * num_leds);
|
Color* colors = malloc(sizeof(Color) * num_leds);
|
||||||
|
|
||||||
struct timeval start_time;
|
|
||||||
gettimeofday(&start_time, NULL);
|
|
||||||
|
|
||||||
while (!stop) {
|
while (!stop) {
|
||||||
struct timeval current_time;
|
struct timeval current_time;
|
||||||
gettimeofday(¤t_time, NULL);
|
gettimeofday(¤t_time, NULL);
|
||||||
|
|||||||
Reference in New Issue
Block a user