소스 검색

fixed warnings

Aareschluchtje 9 년 전
부모
커밋
a47bcbf6c0
10개의 변경된 파일16개의 추가작업 그리고 40개의 파일을 삭제
  1. 1 0
      alarm.h
  2. 3 1
      jsmn.c
  3. 0 13
      keyboard.c
  4. 1 1
      keyboard.h
  5. 1 8
      main.c
  6. 5 2
      network.c
  7. 3 3
      network.h
  8. 2 1
      ntp.c
  9. 0 3
      uart0driver.c
  10. 0 8
      vs10xx.c

+ 1 - 0
alarm.h

@@ -25,4 +25,5 @@ int getState(int idx);
 struct _alarm getAlarm(int idx);
 int maxAlarms(void);
 int isLeapYear(int y);
+void setSnooze(int idx);
 #endif

+ 3 - 1
jsmn.c

@@ -1,4 +1,6 @@
 #include "jsmn.h"
+#include <stdio.h>
+#include <string.h>
 
 /**
  * Allocates a fresh unused token from the token pull.
@@ -334,4 +336,4 @@ int getIntegerToken(const char *json, jsmntok_t *tok){
  */
 void getStringToken(const char *json, jsmntok_t *tok, char *res){
 	sprintf(res, "%.*s", tok->end - tok->start, json + tok->start);
-}
+}

+ 0 - 13
keyboard.c

@@ -192,19 +192,6 @@ static u_char KbRemapKey(u_short LongKey)
     }
 }
 
-/* ����������������������������������������������������������������������� */
-/*!
- * \brief Return the repeating property for this key
- *
- * \return 'TRUE' in case the key was repeating, 'FALSE' if not
- *
- */
-/* ����������������������������������������������������������������������� */
-static u_char KbKeyIsRepeating(u_short Key)
-{
-    return(KeyRepeatArray[KbRemapKey(Key)]==KEY_REPEAT);
-}
-
 /* ����������������������������������������������������������������������� */
 /*!
  * \brief set the property of this key to repeating or not-repeating

+ 1 - 1
keyboard.h

@@ -91,7 +91,7 @@
 /*-------------------------------------------------------------------------*/
 void    KbInit(void);
 void  KbScan(void);
-int 	CheckKey();
+int 	CheckKey(void);
 int     KbWaitForKeyEvent(u_long);
 u_char  KbGetKey(void);
 void    KbSetKeyRepeating(u_char, u_char);

+ 1 - 8
main.c

@@ -44,6 +44,7 @@
 #include "system.h"
 #include "typedefs.h"
 #include "uart0driver.h"
+#include "vs10xx.h"
 #include "watchdog.h"
 
 
@@ -82,15 +83,7 @@ static void SysControlMainBeat(u_char);
  */
 static void SysMainBeatInterrupt(void *p)
 {
-
-    /*
-     *  scan for valid keys
-     */
     KbScan();
-
-    if(KbGetKey() != KEY_NO_KEY){
-        LcdBackLight(LCD_BACKLIGHT_ON);
-    }
 }
 
 /*!

+ 5 - 2
network.c

@@ -7,6 +7,7 @@
 #include <sys/confnet.h>
 #include <sys/socket.h>
 #include <netinet/tcp.h>
+#include <sys/types.h>
 
 #include <stdlib.h>
 #include <string.h>
@@ -17,6 +18,8 @@
 
 #include <stdio.h>
 #include <io.h>
+#include <sys/version.h>
+#include <dev/irqreg.h>
 #include <arpa/inet.h>
 #include <pro/dhcp.h>
 #include <pro/sntp.h>
@@ -47,7 +50,7 @@ void NetworkInit() {
 }
 
 char* getMacAdress(){
-    ether_ntoa(confnet.cdn_mac);
+    return ether_ntoa(confnet.cdn_mac);
 }
 
 void httpGet(char address[], void (*parser)(char*)){
@@ -108,4 +111,4 @@ bool NetworkIsReceiving(void){
 
 bool hasNetworkConnection(void){
     return hasNetwork;
-}
+}

+ 3 - 3
network.h

@@ -4,9 +4,9 @@
 
 #ifndef _Network_H
 #define _Network_H
-
-//bool hasNetworkConnection(void);
-//bool NetworkIsReceiving(void);
+#include "typedefs.h"
+bool hasNetworkConnection(void);
+bool NetworkIsReceiving(void);
 extern void NetworkInit(void);
 extern void httpGet(char address[], void (*parser)(char*));
 char* getMacAdress(void);

+ 2 - 1
ntp.c

@@ -22,6 +22,7 @@
 #include "ntp.h"
 #include "contentparser.h"
 #include "alarm.h"
+#include "network.h"
 
 int TIME_ZONE = 1;
 #define LOG_MODULE  LOG_NTP_MODULE
@@ -86,7 +87,7 @@ void NtpSync(void){
     isSyncing = true;
     httpGet("/gettimezone.php", parsetimezone);
     _daylight = 0;
-    printf(TIME_ZONE);
+    printf("Timezone is: %d", TIME_ZONE);
     NutDelay(100);
     //puts("Tijd ophalen van pool.ntp.org (213.154.229.24)");
     timeserver = inet_addr("213.154.229.24");

+ 0 - 3
uart0driver.c

@@ -106,9 +106,6 @@ THREAD(Uart0KeyEvents, arg)
         result = fgets(result, 16, stream);
         short _reset_received = strcmp(rst, result);
 
-        *rst = "abcde\n";
-        *result = "";
-
         if (_reset_received == 0){
             LogMsg_P(LOG_INFO, PSTR(">>>>>> RESET COMMAND RECEIVED"));
             //RESET SIR!

+ 0 - 8
vs10xx.c

@@ -91,7 +91,6 @@
 /*-------------------------------------------------------------------------*/
 static volatile u_char vs_status = VS_STATUS_STOPPED;
 static u_short g_vs_type;
-static u_char VsPlayMode;
 
 
 static void VsLoadProgramCode(void);
@@ -787,13 +786,6 @@ u_short VsMemoryTest(void)
 int VsSetVolume(u_char left, u_char right)
 {
     u_char ief;
-    if(left < 0){
-        left = 0;
-    }
-    if(right < 0){
-        right = 0;
-    }
-    printf("%d %d", left, right);
 
     ief = VsPlayerInterrupts(0);