feat: added cross compiler and moved headers to include dir

This commit is contained in:
2021-03-09 19:45:20 +01:00
parent cefdb8ed90
commit dc4bf71b5a
77 changed files with 180 additions and 45 deletions

View File

@@ -2,7 +2,7 @@
// Created by rick on 9/22/19.
//
#include "timer.h"
#include <cpu/timer.h>
#include <drivers/ports.h>
#include <cpu/isr.h>
@@ -63,8 +63,8 @@ int init_timer(uint32_t freq) {
register_interrupt_handler(IRQ0, timer_callback);
uint32_t divisor = 1193180 / freq;
uint8_t low = (uint8_t) (divisor & 0xFF);
uint8_t high = (uint8_t) ((divisor >> 8) & 0xFF);
uint8_t low = (uint8_t)(divisor & 0xFF);
uint8_t high = (uint8_t)((divisor >> 8) & 0xFF);
port_byte_out(PORT_PIT_COMMAND,
PIT_MODE_BIN | PIT_MODE_HARDWARE_SQUARE_WAVE_GENERATOR | PIT_ACCESS_MODE_LH | PIT_CHANNEL_0);
port_byte_out(PORT_PIT_DATA_0, low);