Skip to content

Commit

Permalink
The main-laser test program now switches laser power on, sets power l…
Browse files Browse the repository at this point in the history
…evel.
  • Loading branch information
kbob committed Aug 10, 2014
1 parent 3a18d7b commit bf54d95
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions main-laser.c
Expand Up @@ -4,6 +4,10 @@

#include <stdio.h>

#include "ATX_power.h"
#include "heaters.h"
#include "i2c.h"
#include "laser-power.h"
#include "safety-switches.h"
#include "serial.h"
#include "stdio_util.h"
Expand All @@ -14,11 +18,28 @@
int main()
{
init_timer();
init_ATX_power();
init_serial();
init_stdio();
init_safety_switches();
init_i2c();
init_laser_power();
init_heaters();
init_main_laser();
sei();

enable_ATX_power();
uint32_t b = millisecond_time();
while (!ATX_power_state()) {
enable_ATX_power();
continue;
}
uint32_t a = millisecond_time();
printf("ATX power: %ld msec\n", a - b);
enable_heater_1(); // aka water pump
delay_milliseconds(2000);
enable_heater_0(); // aka high voltage supply
set_laser_power(4095 / 3); // 1/3rd power
printf("Main Laser! Danger!\n");

while (true) {
Expand Down

0 comments on commit bf54d95

Please sign in to comment.