Merge changes I8123b26d,Iba069b97

* changes:
  [ion] Fix a volatile error
  [ion] Add a Ion::Log::print method
This commit is contained in:
Émilie Feral
2017-02-15 18:08:27 +01:00
committed by Gerrit
4 changed files with 20 additions and 2 deletions

View File

@@ -8,11 +8,11 @@
#include <ion/events.h>
#include <ion/keyboard.h>
#include <ion/led.h>
#include <ion/log.h>
#include <ion/power.h>
#include <stdint.h>
#include <string.h>
/* ION is not your regular library. It is a library you link against, but it
* will take care of configuring the whole environment for you. In POSIX terms,
* ION will implement the "main" function.

12
ion/include/ion/log.h Normal file
View File

@@ -0,0 +1,12 @@
#ifndef ION_LOG_H
#define ION_LOG_H
namespace Ion {
namespace Log {
void print(const char * message);
}
}
#endif

View File

@@ -46,7 +46,7 @@ public:
class ODR : Register32 {
public:
bool get(int index) { return (bool)getBitRange(index, index); }
bool get(int index) volatile { return (bool)getBitRange(index, index); }
void set(int index, bool state) volatile { setBitRange(index, index, state); }
};

6
ion/src/shared/log.cpp Normal file
View File

@@ -0,0 +1,6 @@
#include <ion/log.h>
#include <stdio.h>
void Ion::Log::print(const char * message) {
printf("%s\n", message);
}