Time of Update: 2018-12-03
最近在做BACnet協議棧開發,在做Linux裝置驅動程式時需要使用GPIO口作為控制訊號,於是Employing char device driver時遇到一些Bug,需要去Fix。#insmod s3c2440_gpf.ko //安裝模組#lsmod //查看主裝置編號,假設為xxx.#mknod /dev/gpf c xxx 0 //建立裝置檔案編寫application程式時,在目標板上運行時居然出現如下error:然後運行app
Time of Update: 2018-12-03
在裝有debianMIPS處理器中,安裝perf工具時遇到的error描述如下:下載相應核心版本,進入tools/perf目錄,首先大致看下Makefile的內容,是否支援MIPS平台,然後安裝perf #makeMakefile:553: DWARF register mappings have not been defined for architecture mips, DWARF support disabledMakefile:565: newt not found,
Time of Update: 2018-12-03
/*mini2440_buttons_my.c*//*後面加了_my*//*按鍵驅動程式*//*mini2440所用到的按鍵資源*//**************************************************//* 按鍵 對應的IO寄存器 對應的中斷引腳*//* K1 GPG0 EINT8 *//* K2 GPG3
Time of Update: 2018-12-03
中斷處理常式應當返回一個值指示是否真正處理了一個中斷。如果處理常式發現裝置確實需要處理, 應當返回 IRQ_HANDLED; 否則傳回值 IRQ_NONE。以下宏可產生傳回值:IRQ_RETVAL(handled) /*若要處理中斷,handled應是非零*/有位網友在處理傳回值是按慣例return 0;,導致了oops。吸取經驗教訓,我們應特別注意這種傳回值,以下是有關中斷處理常式的傳回值的核心定義(#i nclude <linux/irqreturn.h>
Time of Update: 2018-12-03
(name) -- 產生一個等待隊列頭wait_queue_head_t,名字為name-----------------------------------------------------------------#define DECLARE_WAIT_QUEUE_HEAD(name) / wait_queue_head_t name =
Time of Update: 2018-12-03
隨著企業級的資料呈指數增長,傳統的集中式儲存方案已無法滿足其儲存要求,因而儲存地區網(storage area
Time of Update: 2018-12-03
應用程式:#include <syswait.h>usleep(n) //n微秒Sleep(n)//n毫秒sleep(n)//n秒驅動程式:#include <linux/delay.h>mdelay(n) //milliseconds 其實現#ifdef notdef#define mdelay(n) (/{unsigned long msec=(n); while (msec--) udelay(1000);})#else#define mdelay(n) (/(__
Time of Update: 2018-12-03
讓我們來看一個樣本WSDL檔案的結構及工作原理。請注意這隻是一個十分簡單的WSDL文檔執行個體。我們的目的只是簡單展示下最顯著的特徵,後面的章節有對其詳細的討論。<?xml version="1.0" encoding="UTF-8" ?> <definitions name="FooSample" targetNamespace="http://tempuri.org/wsdl/" xmlns:wsdlns="http://tempuri.org/wsdl/"
Time of Update: 2018-12-03
writeb(), writew(), writel() 宏函數功能:往記憶體映射的 I/O 空間上寫資料。writeb() I/O 上寫入 8 位元據 (1位元組)writew() I/O 上寫入 16位元據 (2位元組)wirtel() I/O 上寫入 32 位元據 (4位元組)原型: 引用 #include <asm/io.h>void writeb (unsigned char data, unsigned short addr)void writew
Time of Update: 2018-12-03
先看代碼及注釋:/** * bdget_disk - do bdget() by gendisk and partition number * @disk: gendisk of interest * @partno: partition number * * Find partition @partno from @disk, do bdget() on it. * * CONTEXT: * Don't care. * * RETURNS: * Resulting block_device
Time of Update: 2018-12-03
iOS的keychain服務提供了一種安全的儲存私密資訊(密碼,序號,認證等)的方式。每個ios程式都有一個獨立的keychain儲存。從ios 3。0開始,跨程式分享keychain變得可行。下面我將告訴你如何使用keyChain:1).匯入Security.framework2).Apple已為我們提供了一個訪問keychain封裝檔案(KeychainItemWrapper.h和KeychainItemWrapper.m),匯入標頭檔。#import
Time of Update: 2018-12-03
iphone學習筆記--NSString // 聲明一個NSStringNSString *str;// 使用stringWithFormat產生一格式化字串str = [NSString stringWithFormat:@"This is %@","John"];NSLog(@"str--->%@",str);// 字串長度length;NSLog(@"The length of this string is %@",[str length]);// 字串比較
Time of Update: 2018-12-03
1、手動在控制台添加印表機,選擇“串連到此電腦的本機印表機”,並取消“自動檢測並安裝隨插即用印表機”選擇,連接埠選擇“Adobe PDF”,如果沒有這個連接埠,則選擇建立新連接埠。2、驅動程式不要在列表中選擇,而是選擇從磁碟安裝,選擇指向Acrobat檔案夾下的Xtras子目錄,找到AdobePDF.inf(這個就是關鍵的驅動程式檔案):C:/Program Files/Adobe/Acrobat 9.0/Acrobat/Xtras/AdobePDF(注意是你安裝acrobat的路徑)然後安裝。
Time of Update: 2018-12-03
寄存器 地址 功能BWSCON 0x48000000 匯流排寬度及等待控制寄存器,這個寄存器控制著系統地址空間內(包括bank0-bank7)的匯流排資料寬度以及是否等待BANKCON0 0x48000004
Time of Update: 2018-12-03
一. 表視圖的委託、源以及類綁定 1.設定表視圖分區(組)的方法-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{ //一組 return 1;}2.設定表行數的方法-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{ //兩行 return 2;}
Time of Update: 2018-12-03
從命令列擷取參數,先看代碼:static void address_parse( BACNET_ADDRESS * dst, int argc, char *argv[]){ unsigned mac[6]; unsigned port; int count = 0; int index = 0; if (argc > 0) { count = sscanf(argv[0],
Time of Update: 2018-12-03
Hit http://ftp.us.debian.org squeeze/contrib amd64 PackagesHit http://download.proxmox.com squeeze/pve amd64 PackagesFetched 1,672 B in 0s (2,041 B/s)W: GPG error: http://ftp.us.debian.org squeeze Release: The following signatureswere invalid:
Time of Update: 2018-12-03
JSON資料解析 1. 下載第三方JSON庫。http://code.google.com/p/json-framework/downloads/list2. 下載完成後,雙擊dmg檔案,開啟後把JSON目錄拖至項目 3. 匯入JSON解析庫 #import "JSON.h"4 .解析NSString *jsonString = [NSString stringWithString:@"{\"foo\": \"bar\"}"];NSDictionary *dictionary =
Time of Update: 2018-12-03
與伺服器端的通訊的方式有兩種:1).http 2).socket 3).webservice 下面是在iphone平台上使用http與伺服器端通訊,費話不說,直接代碼。 1. 建立一個基於視圖的應用程式,並命名(這裡命名為NetDemo),開啟NetDemoViewController.h檔案,代碼如下:#import <UIKit/UIKit.h>@interface NetDemoViewController : UIViewController{UIButton
Time of Update: 2018-12-03
我們在寫代碼的時候,按約定都是把成員資料放到private訪問區中,然後在通過相應的函數來存取。那又有什麼樣的代碼可以突破存取權限來直接操作類中private區段中的成員資料呢?首先,我們想到了指標,對吧~指標可是萬能之王,然而也是萬惡之源。那我們就先來看看指標如何突破馬其諾防線的。先定義一個測試類別class X{private:int m_nPrivate;public: X() : m_nPrivate(1) {}template<typename