32 lines
739 B
C
32 lines
739 B
C
|
#include <io.h>
|
||
|
#include <stdbool.h>
|
||
|
#include <stdlib.h>
|
||
|
#include <stdio.h>
|
||
|
|
||
|
#include "lepton/lepton.h"
|
||
|
#include "system.h"
|
||
|
|
||
|
int main(void) {
|
||
|
// Hardware control structures
|
||
|
lepton_dev lepton = lepton_inst((void *) LEPTON_0_BASE);
|
||
|
|
||
|
// Initialize hardware
|
||
|
lepton_init(&lepton);
|
||
|
|
||
|
// =========================================================================
|
||
|
|
||
|
|
||
|
do {
|
||
|
lepton_start_capture(&lepton);
|
||
|
lepton_wait_until_eof(&lepton);
|
||
|
} while(lepton_error_check(&lepton));
|
||
|
|
||
|
//
|
||
|
// =========================================================================
|
||
|
|
||
|
// Save the adjusted (rescaled) buffer to a file.
|
||
|
lepton_save_capture(&lepton, true, "/mnt/host/output.pgm");
|
||
|
|
||
|
return EXIT_SUCCESS;
|
||
|
}
|